{"action":"reopened","number":34258,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/34258","id":224231595,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MjMxNTk1","html_url":"https://github.com/rails/rails/pull/34258","diff_url":"https://github.com/rails/rails/pull/34258.diff","patch_url":"https://github.com/rails/rails/pull/34258.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/34258","number":34258,"state":"open","locked":false,"title":"Remove circular dependency warnings in ActionCable javascript and include source code in published package","user":{"login":"rmacklin","id":1863540,"node_id":"MDQ6VXNlcjE4NjM1NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1863540?v=4","gravatar_id":"","url":"https://api.github.com/users/rmacklin","html_url":"https://github.com/rmacklin","followers_url":"https://api.github.com/users/rmacklin/followers","following_url":"https://api.github.com/users/rmacklin/following{/other_user}","gists_url":"https://api.github.com/users/rmacklin/gists{/gist_id}","starred_url":"https://api.github.com/users/rmacklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmacklin/subscriptions","organizations_url":"https://api.github.com/users/rmacklin/orgs","repos_url":"https://api.github.com/users/rmacklin/repos","events_url":"https://api.github.com/users/rmacklin/events{/privacy}","received_events_url":"https://api.github.com/users/rmacklin/received_events","type":"User","site_admin":false},"body":"_Note: This PR was split out from https://github.com/rails/rails/pull/34177. All of the commits in that PR are currently in this PR too. This PR is just for the last 9 commits. If we can create the [`convert-actioncable-to-es2015` branch from my fork](https://github.com/rmacklin/rails/tree/convert-actioncable-to-es2015) branch in the rails/rails upstream, I can change the base branch to make this PR only display those 9 commits. For the time being, here is a mirror PR in my fork which only includes those commits: https://github.com/rmacklin/rails/pull/1_\r\n\r\n### Summary\r\n\r\nIn https://github.com/rails/rails/pull/34177, we've converted the ActionCable javascript to ES2015 (in that PR we avoided refactoring the existing structure, which has some circular dependency warnings). This PR builds on top of that work. In this PR we:\r\n\r\n1. Reorganize the module imports to remove the circular dependency warnings\r\n2. Update the ActionCable npm package to ship untranspiled ES2015 source code in addition to the heavier compiled bundle\r\n   - This enables ActionCable users to ship smaller javascript bundles to their visitors with modern browsers. We added this enhancement to ActiveStorage in https://github.com/rails/rails/pull/31880.\r\n\r\nIn an [example repository](https://github.com/rmacklin/actioncable-es2015-build-example), the bundle shrinks by 2.5K (23%) when you simply change the actioncable import to point to the untranspiled src, e.g. by [setting up an alias](https://github.com/rmacklin/actioncable-es2015-build-example/commit/278154577d85e9e8f3231b1d268d12f8a3fd49af):\r\n\r\n```\r\nresolve: {\r\n  alias: {\r\n    actioncable: 'actioncable/src'\r\n  }\r\n}\r\n```\r\n\r\nIf you go a step further, by [using a fine-grained import to pull in only what your app uses](https://github.com/rmacklin/actioncable-es2015-build-example/commit/d494d6bf160042ca218bf3bd7aae6c1929492e0b), e.g.:\r\n```diff\r\ndiff --git a/app/scripts/main.js b/app/scripts/main.js\r\nindex 17bc031..1a2b2e0 100644\r\n--- a/app/scripts/main.js\r\n+++ b/app/scripts/main.js\r\n@@ -1,6 +1,6 @@\r\n-import ActionCable from 'actioncable';\r\n+import {createConsumer} from 'actioncable/action_cable';\r\n\r\n-let cable = ActionCable.createConsumer('wss://cable.example.com');\r\n+let cable = createConsumer('wss://cable.example.com');\r\n\r\n cable.subscriptions.create('AppearanceChannel', {\r\n```\r\n\r\nthen the bundle shrinks by 3.2K (30%).","created_at":"2018-10-19T09:55:25Z","updated_at":"2018-11-02T16:41:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d49e162edf847c9b0649b7d569b3d95d4713736","assignee":{"login":"sgrif","id":1529387,"node_id":"MDQ6VXNlcjE1MjkzODc=","avatar_url":"https://avatars2.githubusercontent.com/u/1529387?v=4","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"assignees":[{"login":"sgrif","id":1529387,"node_id":"MDQ6VXNlcjE1MjkzODc=","avatar_url":"https://avatars2.githubusercontent.com/u/1529387?v=4","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":300028327,"node_id":"MDU6TGFiZWwzMDAwMjgzMjc=","url":"https://api.github.com/repos/rails/rails/labels/actioncable","name":"actioncable","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/34258/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/34258/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/34258/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/e02b54c060529b9b1b867d0e10e5ea36feff5b71","head":{"label":"rmacklin:remove-circular-dependency-warnings-in-actioncable-and-publish-source","ref":"remove-circular-dependency-warnings-in-actioncable-and-publish-source","sha":"e02b54c060529b9b1b867d0e10e5ea36feff5b71","user":{"login":"rmacklin","id":1863540,"node_id":"MDQ6VXNlcjE4NjM1NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1863540?v=4","gravatar_id":"","url":"https://api.github.com/users/rmacklin","html_url":"https://github.com/rmacklin","followers_url":"https://api.github.com/users/rmacklin/followers","following_url":"https://api.github.com/users/rmacklin/following{/other_user}","gists_url":"https://api.github.com/users/rmacklin/gists{/gist_id}","starred_url":"https://api.github.com/users/rmacklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmacklin/subscriptions","organizations_url":"https://api.github.com/users/rmacklin/orgs","repos_url":"https://api.github.com/users/rmacklin/repos","events_url":"https://api.github.com/users/rmacklin/events{/privacy}","received_events_url":"https://api.github.com/users/rmacklin/received_events","type":"User","site_admin":false},"repo":{"id":113755247,"node_id":"MDEwOlJlcG9zaXRvcnkxMTM3NTUyNDc=","name":"rails","full_name":"rmacklin/rails","private":false,"owner":{"login":"rmacklin","id":1863540,"node_id":"MDQ6VXNlcjE4NjM1NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1863540?v=4","gravatar_id":"","url":"https://api.github.com/users/rmacklin","html_url":"https://github.com/rmacklin","followers_url":"https://api.github.com/users/rmacklin/followers","following_url":"https://api.github.com/users/rmacklin/following{/other_user}","gists_url":"https://api.github.com/users/rmacklin/gists{/gist_id}","starred_url":"https://api.github.com/users/rmacklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmacklin/subscriptions","organizations_url":"https://api.github.com/users/rmacklin/orgs","repos_url":"https://api.github.com/users/rmacklin/repos","events_url":"https://api.github.com/users/rmacklin/events{/privacy}","received_events_url":"https://api.github.com/users/rmacklin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rmacklin/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/rmacklin/rails","forks_url":"https://api.github.com/repos/rmacklin/rails/forks","keys_url":"https://api.github.com/repos/rmacklin/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmacklin/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmacklin/rails/teams","hooks_url":"https://api.github.com/repos/rmacklin/rails/hooks","issue_events_url":"https://api.github.com/repos/rmacklin/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rmacklin/rails/events","assignees_url":"https://api.github.com/repos/rmacklin/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rmacklin/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rmacklin/rails/tags","blobs_url":"https://api.github.com/repos/rmacklin/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmacklin/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmacklin/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmacklin/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmacklin/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rmacklin/rails/languages","stargazers_url":"https://api.github.com/repos/rmacklin/rails/stargazers","contributors_url":"https://api.github.com/repos/rmacklin/rails/contributors","subscribers_url":"https://api.github.com/repos/rmacklin/rails/subscribers","subscription_url":"https://api.github.com/repos/rmacklin/rails/subscription","commits_url":"https://api.github.com/repos/rmacklin/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmacklin/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmacklin/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmacklin/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmacklin/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rmacklin/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmacklin/rails/merges","archive_url":"https://api.github.com/repos/rmacklin/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmacklin/rails/downloads","issues_url":"https://api.github.com/repos/rmacklin/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rmacklin/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rmacklin/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rmacklin/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmacklin/rails/labels{/name}","releases_url":"https://api.github.com/repos/rmacklin/rails/releases{/id}","deployments_url":"https://api.github.com/repos/rmacklin/rails/deployments","created_at":"2017-12-10T14:09:51Z","updated_at":"2018-11-02T14:55:51Z","pushed_at":"2018-11-02T16:00:25Z","git_url":"git://github.com/rmacklin/rails.git","ssh_url":"git@github.com:rmacklin/rails.git","clone_url":"https://github.com/rmacklin/rails.git","svn_url":"https://github.com/rmacklin/rails","homepage":"http://rubyonrails.org","size":166539,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"d80925b169f0db950697868f5659a67cc03e8654","user":{"login":"rails","id":4223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyMjM=","avatar_url":"https://avatars1.githubusercontent.com/u/4223?v=4","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"node_id":"MDEwOlJlcG9zaXRvcnk4NTE0","name":"rails","full_name":"rails/rails","private":false,"owner":{"login":"rails","id":4223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyMjM=","avatar_url":"https://avatars1.githubusercontent.com/u/4223?v=4","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","deployments_url":"https://api.github.com/repos/rails/rails/deployments","created_at":"2008-04-11T02:19:47Z","updated_at":"2018-11-02T16:32:50Z","pushed_at":"2018-11-02T16:00:30Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"https://rubyonrails.org","size":167696,"stargazers_count":41296,"watchers_count":41296,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16673,"mirror_url":null,"archived":false,"open_issues_count":1042,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":16673,"open_issues":1042,"watchers":41296,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/34258"},"html":{"href":"https://github.com/rails/rails/pull/34258"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/34258"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/34258/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/34258/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/34258/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/e02b54c060529b9b1b867d0e10e5ea36feff5b71"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":1,"review_comments":8,"maintainer_can_modify":true,"commits":13,"additions":3103,"deletions":479,"changed_files":25}}
{"actor":{"display_login":"rmacklin"}}