{"action":"created","comment":{"url":"https://api.github.com/repos/google/blockly/pulls/comments/166766413","pull_request_review_id":94882719,"id":166766413,"diff_hunk":"@@ -52,6 +52,52 @@ Blockly.Field = function(text, opt_validator) {\n   this.setValidator(opt_validator);\n };\n \n+/**\n+ * The set of all registered fields, keyed by field type as used in the JSON\n+ * definition of a block.\n+ * @private","path":"core/field.js","position":7,"original_position":7,"commit_id":"1624f654b1db6c0e12d519d1da3a6729b0a4d55f","original_commit_id":"d848d581347bf50346ea4fcb4c795a5bbc8f9e74","user":{"login":"rachel-fenichel","id":13686399,"avatar_url":"https://avatars2.githubusercontent.com/u/13686399?v=4","gravatar_id":"","url":"https://api.github.com/users/rachel-fenichel","html_url":"https://github.com/rachel-fenichel","followers_url":"https://api.github.com/users/rachel-fenichel/followers","following_url":"https://api.github.com/users/rachel-fenichel/following{/other_user}","gists_url":"https://api.github.com/users/rachel-fenichel/gists{/gist_id}","starred_url":"https://api.github.com/users/rachel-fenichel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachel-fenichel/subscriptions","organizations_url":"https://api.github.com/users/rachel-fenichel/orgs","repos_url":"https://api.github.com/users/rachel-fenichel/repos","events_url":"https://api.github.com/users/rachel-fenichel/events{/privacy}","received_events_url":"https://api.github.com/users/rachel-fenichel/received_events","type":"User","site_admin":false},"body":"Add a type annotation.  I think it's:\r\n`@type {string, !{fromJson: Function}}`\r\n","created_at":"2018-02-07T21:47:44Z","updated_at":"2018-02-07T22:02:22Z","html_url":"https://github.com/google/blockly/pull/1594#discussion_r166766413","pull_request_url":"https://api.github.com/repos/google/blockly/pulls/1594","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/google/blockly/pulls/comments/166766413"},"html":{"href":"https://github.com/google/blockly/pull/1594#discussion_r166766413"},"pull_request":{"href":"https://api.github.com/repos/google/blockly/pulls/1594"}}},"pull_request":{"url":"https://api.github.com/repos/google/blockly/pulls/1594","id":167812709,"html_url":"https://github.com/google/blockly/pull/1594","diff_url":"https://github.com/google/blockly/pull/1594.diff","patch_url":"https://github.com/google/blockly/pull/1594.patch","issue_url":"https://api.github.com/repos/google/blockly/issues/1594","number":1594,"state":"open","locked":false,"title":"Customising field types using a register of fields #1584","user":{"login":"jollytoad","id":71291,"avatar_url":"https://avatars0.githubusercontent.com/u/71291?v=4","gravatar_id":"","url":"https://api.github.com/users/jollytoad","html_url":"https://github.com/jollytoad","followers_url":"https://api.github.com/users/jollytoad/followers","following_url":"https://api.github.com/users/jollytoad/following{/other_user}","gists_url":"https://api.github.com/users/jollytoad/gists{/gist_id}","starred_url":"https://api.github.com/users/jollytoad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jollytoad/subscriptions","organizations_url":"https://api.github.com/users/jollytoad/orgs","repos_url":"https://api.github.com/users/jollytoad/repos","events_url":"https://api.github.com/users/jollytoad/events{/privacy}","received_events_url":"https://api.github.com/users/jollytoad/received_events","type":"User","site_admin":false},"body":"<!--\r\n  - Thanks for submitting code to Blockly!  Please fill out the following as part of\r\n  - your pull request so we can review your code more easily.\r\n  -->\r\n\r\n## The basics\r\n\r\n<!-- TODO: Verify the following, checking each box with an 'x' between the brackets: [x] -->\r\n\r\n- [x] I branched from develop\r\n- [x] My pull request is against develop\r\n- [x] My code follows the [style guide](https://developers.google.com/blockly/guides/modify/web/style-guide)\r\n\r\n## The details\r\n### Resolves\r\n\r\n<!-- TODO: What Github issue does this resolve? Please include a link. -->\r\n#1584\r\n\r\n### Proposed Changes\r\n\r\n<!-- TODO: Describe what this Pull Request does.  Include screenshots if applicable. -->\r\n\r\n* Adds a register for Blockly.Field types\r\n* Adds a Blockly.Field.fromJson to construct the appropriate field instance according to the register\r\n* Existing fields now register themselves, allowing exclusion or replacement of the entire field\r\n\r\n### Reason for Changes\r\n\r\n<!--TODO: Explain why these changes should be made.  Include screenshots if applicable. -->\r\n\r\nAllow adding of new field types and overriding of the standard ones without having to hack the core of Blockly. See #1584 for more details.\r\n\r\n### Test Coverage\r\n\r\n<!-- TODO: Please show how you have added tests to cover your changes,\r\n  -        or tell us how you tested it. For each systems you tested,\r\n  -        uncomment the systems in the list below.\r\n  -->\r\n\r\nExisting json tests provide some assurance, although they don't appear to have comprehensive coverage for all field types.\r\n\r\nTested on:\r\n\r\n* Desktop Chrome\r\n\r\n<!-- * Desktop Firefox -->\r\n<!-- * Desktop Safari -->\r\n<!-- * Desktop Opera -->\r\n<!-- * Windows Internet Explorer 10 -->\r\n<!-- * Windows Internet Explorer 11 -->\r\n<!-- * Windows Edge -->\r\n\r\n<!--\r\n* Smartphone/Tablet/Chromebook (please complete the following information):\r\n  * Device: [e.g. iPhone6]\r\n  * OS: [e.g. iOS8.1]\r\n  * Browser [e.g. stock browser, safari]\r\n  * Version [e.g. 22]\r\n-->\r\n\r\n### Additional Information\r\n\r\n<!-- Anything else we should know? -->\r\n","created_at":"2018-02-07T21:23:23Z","updated_at":"2018-02-07T22:02:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"948469fa54bbfe2f1606646bed761d4168a92efb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/blockly/pulls/1594/commits","review_comments_url":"https://api.github.com/repos/google/blockly/pulls/1594/comments","review_comment_url":"https://api.github.com/repos/google/blockly/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/blockly/issues/1594/comments","statuses_url":"https://api.github.com/repos/google/blockly/statuses/1624f654b1db6c0e12d519d1da3a6729b0a4d55f","head":{"label":"jollytoad:feature-1584-field-register","ref":"feature-1584-field-register","sha":"1624f654b1db6c0e12d519d1da3a6729b0a4d55f","user":{"login":"jollytoad","id":71291,"avatar_url":"https://avatars0.githubusercontent.com/u/71291?v=4","gravatar_id":"","url":"https://api.github.com/users/jollytoad","html_url":"https://github.com/jollytoad","followers_url":"https://api.github.com/users/jollytoad/followers","following_url":"https://api.github.com/users/jollytoad/following{/other_user}","gists_url":"https://api.github.com/users/jollytoad/gists{/gist_id}","starred_url":"https://api.github.com/users/jollytoad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jollytoad/subscriptions","organizations_url":"https://api.github.com/users/jollytoad/orgs","repos_url":"https://api.github.com/users/jollytoad/repos","events_url":"https://api.github.com/users/jollytoad/events{/privacy}","received_events_url":"https://api.github.com/users/jollytoad/received_events","type":"User","site_admin":false},"repo":{"id":120610781,"name":"blockly","full_name":"jollytoad/blockly","owner":{"login":"jollytoad","id":71291,"avatar_url":"https://avatars0.githubusercontent.com/u/71291?v=4","gravatar_id":"","url":"https://api.github.com/users/jollytoad","html_url":"https://github.com/jollytoad","followers_url":"https://api.github.com/users/jollytoad/followers","following_url":"https://api.github.com/users/jollytoad/following{/other_user}","gists_url":"https://api.github.com/users/jollytoad/gists{/gist_id}","starred_url":"https://api.github.com/users/jollytoad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jollytoad/subscriptions","organizations_url":"https://api.github.com/users/jollytoad/orgs","repos_url":"https://api.github.com/users/jollytoad/repos","events_url":"https://api.github.com/users/jollytoad/events{/privacy}","received_events_url":"https://api.github.com/users/jollytoad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jollytoad/blockly","description":"The web-based visual programming editor.","fork":true,"url":"https://api.github.com/repos/jollytoad/blockly","forks_url":"https://api.github.com/repos/jollytoad/blockly/forks","keys_url":"https://api.github.com/repos/jollytoad/blockly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jollytoad/blockly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jollytoad/blockly/teams","hooks_url":"https://api.github.com/repos/jollytoad/blockly/hooks","issue_events_url":"https://api.github.com/repos/jollytoad/blockly/issues/events{/number}","events_url":"https://api.github.com/repos/jollytoad/blockly/events","assignees_url":"https://api.github.com/repos/jollytoad/blockly/assignees{/user}","branches_url":"https://api.github.com/repos/jollytoad/blockly/branches{/branch}","tags_url":"https://api.github.com/repos/jollytoad/blockly/tags","blobs_url":"https://api.github.com/repos/jollytoad/blockly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jollytoad/blockly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jollytoad/blockly/git/refs{/sha}","trees_url":"https://api.github.com/repos/jollytoad/blockly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jollytoad/blockly/statuses/{sha}","languages_url":"https://api.github.com/repos/jollytoad/blockly/languages","stargazers_url":"https://api.github.com/repos/jollytoad/blockly/stargazers","contributors_url":"https://api.github.com/repos/jollytoad/blockly/contributors","subscribers_url":"https://api.github.com/repos/jollytoad/blockly/subscribers","subscription_url":"https://api.github.com/repos/jollytoad/blockly/subscription","commits_url":"https://api.github.com/repos/jollytoad/blockly/commits{/sha}","git_commits_url":"https://api.github.com/repos/jollytoad/blockly/git/commits{/sha}","comments_url":"https://api.github.com/repos/jollytoad/blockly/comments{/number}","issue_comment_url":"https://api.github.com/repos/jollytoad/blockly/issues/comments{/number}","contents_url":"https://api.github.com/repos/jollytoad/blockly/contents/{+path}","compare_url":"https://api.github.com/repos/jollytoad/blockly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jollytoad/blockly/merges","archive_url":"https://api.github.com/repos/jollytoad/blockly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jollytoad/blockly/downloads","issues_url":"https://api.github.com/repos/jollytoad/blockly/issues{/number}","pulls_url":"https://api.github.com/repos/jollytoad/blockly/pulls{/number}","milestones_url":"https://api.github.com/repos/jollytoad/blockly/milestones{/number}","notifications_url":"https://api.github.com/repos/jollytoad/blockly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jollytoad/blockly/labels{/name}","releases_url":"https://api.github.com/repos/jollytoad/blockly/releases{/id}","deployments_url":"https://api.github.com/repos/jollytoad/blockly/deployments","created_at":"2018-02-07T12:13:36Z","updated_at":"2018-02-07T12:13:40Z","pushed_at":"2018-02-07T21:55:24Z","git_url":"git://github.com/jollytoad/blockly.git","ssh_url":"git@github.com:jollytoad/blockly.git","clone_url":"https://github.com/jollytoad/blockly.git","svn_url":"https://github.com/jollytoad/blockly","homepage":"https://developers.google.com/blockly/","size":65843,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"google:develop","ref":"develop","sha":"85cb2b8c41fcc75a3a7d064e7c1cc2c5e5beda35","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":13872231,"name":"blockly","full_name":"google/blockly","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/blockly","description":"The web-based visual programming editor.","fork":false,"url":"https://api.github.com/repos/google/blockly","forks_url":"https://api.github.com/repos/google/blockly/forks","keys_url":"https://api.github.com/repos/google/blockly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/blockly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/blockly/teams","hooks_url":"https://api.github.com/repos/google/blockly/hooks","issue_events_url":"https://api.github.com/repos/google/blockly/issues/events{/number}","events_url":"https://api.github.com/repos/google/blockly/events","assignees_url":"https://api.github.com/repos/google/blockly/assignees{/user}","branches_url":"https://api.github.com/repos/google/blockly/branches{/branch}","tags_url":"https://api.github.com/repos/google/blockly/tags","blobs_url":"https://api.github.com/repos/google/blockly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/blockly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/blockly/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/blockly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/blockly/statuses/{sha}","languages_url":"https://api.github.com/repos/google/blockly/languages","stargazers_url":"https://api.github.com/repos/google/blockly/stargazers","contributors_url":"https://api.github.com/repos/google/blockly/contributors","subscribers_url":"https://api.github.com/repos/google/blockly/subscribers","subscription_url":"https://api.github.com/repos/google/blockly/subscription","commits_url":"https://api.github.com/repos/google/blockly/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/blockly/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/blockly/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/blockly/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/blockly/contents/{+path}","compare_url":"https://api.github.com/repos/google/blockly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/blockly/merges","archive_url":"https://api.github.com/repos/google/blockly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/blockly/downloads","issues_url":"https://api.github.com/repos/google/blockly/issues{/number}","pulls_url":"https://api.github.com/repos/google/blockly/pulls{/number}","milestones_url":"https://api.github.com/repos/google/blockly/milestones{/number}","notifications_url":"https://api.github.com/repos/google/blockly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/blockly/labels{/name}","releases_url":"https://api.github.com/repos/google/blockly/releases{/id}","deployments_url":"https://api.github.com/repos/google/blockly/deployments","created_at":"2013-10-25T21:13:33Z","updated_at":"2018-02-07T10:07:35Z","pushed_at":"2018-02-07T21:55:25Z","git_url":"git://github.com/google/blockly.git","ssh_url":"git@github.com:google/blockly.git","clone_url":"https://github.com/google/blockly.git","svn_url":"https://github.com/google/blockly","homepage":"https://developers.google.com/blockly/","size":67528,"stargazers_count":4256,"watchers_count":4256,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1556,"mirror_url":null,"archived":false,"open_issues_count":303,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1556,"open_issues":303,"watchers":4256,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/blockly/pulls/1594"},"html":{"href":"https://github.com/google/blockly/pull/1594"},"issue":{"href":"https://api.github.com/repos/google/blockly/issues/1594"},"comments":{"href":"https://api.github.com/repos/google/blockly/issues/1594/comments"},"review_comments":{"href":"https://api.github.com/repos/google/blockly/pulls/1594/comments"},"review_comment":{"href":"https://api.github.com/repos/google/blockly/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/blockly/pulls/1594/commits"},"statuses":{"href":"https://api.github.com/repos/google/blockly/statuses/1624f654b1db6c0e12d519d1da3a6729b0a4d55f"}},"author_association":"NONE"}}
{"actor":{"display_login":"rachel-fenichel"}}