{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amp-wp/pulls/comments/244817109","pull_request_review_id":188781508,"id":244817109,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDgxNzEwOQ==","diff_hunk":"@@ -334,6 +334,16 @@ function amp_add_generator_metadata() {\n  */\n function amp_register_default_scripts( $wp_scripts ) {\n \n+\t// Polyfill dependencies that are registered in Gutenberg and WordPress 5.0.\n+\tif ( ! has_action( 'wp_default_scripts', 'gutenberg_register_packages_scripts' ) ) {","path":"includes/amp-helper-functions.php","position":5,"original_position":5,"commit_id":"d5dbf322cc941cb5a5b0a9cc81947468bf991c97","original_commit_id":"d5dbf322cc941cb5a5b0a9cc81947468bf991c97","user":{"login":"westonruter","id":134745,"node_id":"MDQ6VXNlcjEzNDc0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/134745?v=4","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"body":"That being said, `gutenberg_register_packages_scripts()` explicitly accounts for this case in `gutenberg_register_packages_scripts()` by [calling `gutenberg_override_script()`](https://github.com/WordPress/gutenberg/blob/80be381921ce818c0381e877f510bbc0be0fcf24/lib/client-assets.php#L144-L159) which does `wp_deregister_script()` first. So it looks like the condition is indeed unnecessary.","created_at":"2019-01-02T18:42:41Z","updated_at":"2019-01-02T18:42:41Z","html_url":"https://github.com/ampproject/amp-wp/pull/1781#discussion_r244817109","pull_request_url":"https://api.github.com/repos/ampproject/amp-wp/pulls/1781","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amp-wp/pulls/comments/244817109"},"html":{"href":"https://github.com/ampproject/amp-wp/pull/1781#discussion_r244817109"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amp-wp/pulls/1781"}},"in_reply_to_id":244796783},"pull_request":{"url":"https://api.github.com/repos/ampproject/amp-wp/pulls/1781","id":241237425,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMjM3NDI1","html_url":"https://github.com/ampproject/amp-wp/pull/1781","diff_url":"https://github.com/ampproject/amp-wp/pull/1781.diff","patch_url":"https://github.com/ampproject/amp-wp/pull/1781.patch","issue_url":"https://api.github.com/repos/ampproject/amp-wp/issues/1781","number":1781,"state":"open","locked":false,"title":"Prevent re-bundling WordPress packages","user":{"login":"westonruter","id":134745,"node_id":"MDQ6VXNlcjEzNDc0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/134745?v=4","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"body":"* Eliminate re-bundling of `@wordpress/dom-ready` and `@wordpress/i18n` to instead rely on existing bundles if available. Ensure both are marked as `devDependencies`.\r\n* Include new standalone bundles of `@wordpress/dom-ready` and `@wordpress/i18n` if not available (e.g. in WordPress 4.9 without Gutenberg).\r\n* Eliminate use of JSHint to avoid having to maintain duplicate duplicate linter as ESLint.\r\n\r\n~The `@wordpress/dom-ready` package is bundled with both WordPress 5.0 and Gutenberg as `wp-dom-ready`, so we should use it.~\r\n\r\n~Also, `@wordpress/i18n` is not even used in the project anymore, so we don't need it at all.~\r\n\r\n~**Problem:** If on 4.9 and Gutenberg is not installed, then we need to polyfill `wp-dom-ready` with `jQuery.ready()`. Nevertheless, we are currently depending on `wp-i18n` even though it may not be available either. So we might need to make the plugin require WordPress 5.0 or WordPress 4.9 with Gutenberg as the minimum version. Or perhaps in that case we should still bundle those dependencies as separate scripts that we register? If we want to support 4.9 without Gutenberg, then I suppose this is what we'd have to do. @felixarntz thoughts?~\r\n\r\nCloses #1763.\r\n\r\n\r\n","created_at":"2018-12-27T23:11:16Z","updated_at":"2019-01-02T18:42:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"291f1cb705c9e394ed25212aee778dabec4d561f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1159859621,"node_id":"MDU6TGFiZWwxMTU5ODU5NjIx","url":"https://api.github.com/repos/ampproject/amp-wp/labels/cla:%20yes","name":"cla: yes","color":"6deda0","default":false}],"milestone":{"url":"https://api.github.com/repos/ampproject/amp-wp/milestones/12","html_url":"https://github.com/ampproject/amp-wp/milestone/12","labels_url":"https://api.github.com/repos/ampproject/amp-wp/milestones/12/labels","id":3894282,"node_id":"MDk6TWlsZXN0b25lMzg5NDI4Mg==","number":12,"title":"v 1.0.2","description":"","creator":{"login":"alcurrie","id":18579988,"node_id":"MDQ6VXNlcjE4NTc5OTg4","avatar_url":"https://avatars3.githubusercontent.com/u/18579988?v=4","gravatar_id":"","url":"https://api.github.com/users/alcurrie","html_url":"https://github.com/alcurrie","followers_url":"https://api.github.com/users/alcurrie/followers","following_url":"https://api.github.com/users/alcurrie/following{/other_user}","gists_url":"https://api.github.com/users/alcurrie/gists{/gist_id}","starred_url":"https://api.github.com/users/alcurrie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcurrie/subscriptions","organizations_url":"https://api.github.com/users/alcurrie/orgs","repos_url":"https://api.github.com/users/alcurrie/repos","events_url":"https://api.github.com/users/alcurrie/events{/privacy}","received_events_url":"https://api.github.com/users/alcurrie/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":4,"state":"open","created_at":"2018-12-12T22:01:15Z","updated_at":"2019-01-02T18:07:52Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/ampproject/amp-wp/pulls/1781/commits","review_comments_url":"https://api.github.com/repos/ampproject/amp-wp/pulls/1781/comments","review_comment_url":"https://api.github.com/repos/ampproject/amp-wp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amp-wp/issues/1781/comments","statuses_url":"https://api.github.com/repos/ampproject/amp-wp/statuses/d5dbf322cc941cb5a5b0a9cc81947468bf991c97","head":{"label":"ampproject:remove/redundant-dependencies-1.0","ref":"remove/redundant-dependencies-1.0","sha":"d5dbf322cc941cb5a5b0a9cc81947468bf991c97","user":{"login":"ampproject","id":14114390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTE0Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":42912130,"node_id":"MDEwOlJlcG9zaXRvcnk0MjkxMjEzMA==","name":"amp-wp","full_name":"ampproject/amp-wp","private":false,"owner":{"login":"ampproject","id":14114390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTE0Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ampproject/amp-wp","description":"Enable AMP on your WordPress site, the WordPress way.","fork":false,"url":"https://api.github.com/repos/ampproject/amp-wp","forks_url":"https://api.github.com/repos/ampproject/amp-wp/forks","keys_url":"https://api.github.com/repos/ampproject/amp-wp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amp-wp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amp-wp/teams","hooks_url":"https://api.github.com/repos/ampproject/amp-wp/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amp-wp/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amp-wp/events","assignees_url":"https://api.github.com/repos/ampproject/amp-wp/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amp-wp/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amp-wp/tags","blobs_url":"https://api.github.com/repos/ampproject/amp-wp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amp-wp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amp-wp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amp-wp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amp-wp/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amp-wp/languages","stargazers_url":"https://api.github.com/repos/ampproject/amp-wp/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amp-wp/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amp-wp/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amp-wp/subscription","commits_url":"https://api.github.com/repos/ampproject/amp-wp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amp-wp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amp-wp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amp-wp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amp-wp/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amp-wp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amp-wp/merges","archive_url":"https://api.github.com/repos/ampproject/amp-wp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amp-wp/downloads","issues_url":"https://api.github.com/repos/ampproject/amp-wp/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amp-wp/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amp-wp/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amp-wp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amp-wp/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amp-wp/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amp-wp/deployments","created_at":"2015-09-22T04:52:15Z","updated_at":"2018-12-30T22:23:50Z","pushed_at":"2019-01-02T18:07:57Z","git_url":"git://github.com/ampproject/amp-wp.git","ssh_url":"git@github.com:ampproject/amp-wp.git","clone_url":"https://github.com/ampproject/amp-wp.git","svn_url":"https://github.com/ampproject/amp-wp","homepage":"https://wordpress.org/plugins/amp/","size":24091,"stargazers_count":1308,"watchers_count":1308,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":286,"mirror_url":null,"archived":false,"open_issues_count":143,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":286,"open_issues":143,"watchers":1308,"default_branch":"develop"}},"base":{"label":"ampproject:1.0","ref":"1.0","sha":"1f77fdec404dea3fbbcfba2c26dc88d0b843e511","user":{"login":"ampproject","id":14114390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTE0Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":42912130,"node_id":"MDEwOlJlcG9zaXRvcnk0MjkxMjEzMA==","name":"amp-wp","full_name":"ampproject/amp-wp","private":false,"owner":{"login":"ampproject","id":14114390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTE0Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ampproject/amp-wp","description":"Enable AMP on your WordPress site, the WordPress way.","fork":false,"url":"https://api.github.com/repos/ampproject/amp-wp","forks_url":"https://api.github.com/repos/ampproject/amp-wp/forks","keys_url":"https://api.github.com/repos/ampproject/amp-wp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amp-wp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amp-wp/teams","hooks_url":"https://api.github.com/repos/ampproject/amp-wp/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amp-wp/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amp-wp/events","assignees_url":"https://api.github.com/repos/ampproject/amp-wp/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amp-wp/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amp-wp/tags","blobs_url":"https://api.github.com/repos/ampproject/amp-wp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amp-wp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amp-wp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amp-wp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amp-wp/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amp-wp/languages","stargazers_url":"https://api.github.com/repos/ampproject/amp-wp/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amp-wp/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amp-wp/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amp-wp/subscription","commits_url":"https://api.github.com/repos/ampproject/amp-wp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amp-wp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amp-wp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amp-wp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amp-wp/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amp-wp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amp-wp/merges","archive_url":"https://api.github.com/repos/ampproject/amp-wp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amp-wp/downloads","issues_url":"https://api.github.com/repos/ampproject/amp-wp/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amp-wp/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amp-wp/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amp-wp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amp-wp/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amp-wp/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amp-wp/deployments","created_at":"2015-09-22T04:52:15Z","updated_at":"2018-12-30T22:23:50Z","pushed_at":"2019-01-02T18:07:57Z","git_url":"git://github.com/ampproject/amp-wp.git","ssh_url":"git@github.com:ampproject/amp-wp.git","clone_url":"https://github.com/ampproject/amp-wp.git","svn_url":"https://github.com/ampproject/amp-wp","homepage":"https://wordpress.org/plugins/amp/","size":24091,"stargazers_count":1308,"watchers_count":1308,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":286,"mirror_url":null,"archived":false,"open_issues_count":143,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":286,"open_issues":143,"watchers":1308,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amp-wp/pulls/1781"},"html":{"href":"https://github.com/ampproject/amp-wp/pull/1781"},"issue":{"href":"https://api.github.com/repos/ampproject/amp-wp/issues/1781"},"comments":{"href":"https://api.github.com/repos/ampproject/amp-wp/issues/1781/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amp-wp/pulls/1781/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amp-wp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amp-wp/pulls/1781/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amp-wp/statuses/d5dbf322cc941cb5a5b0a9cc81947468bf991c97"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"westonruter"}}