{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8544","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8544/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8544/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8544/events","html_url":"https://github.com/Automattic/wp-calypso/pull/8544","id":181438483,"number":8544,"title":"Framework: Implement AsyncLoad for code-splitting using Babel plugin","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Components","name":"Components","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Framework","name":"Framework","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-06T14:56:06Z","updated_at":"2016-10-10T15:30:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8544","html_url":"https://github.com/Automattic/wp-calypso/pull/8544","diff_url":"https://github.com/Automattic/wp-calypso/pull/8544.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/8544.patch"},"body":"Supersedes #5356\r\n\r\nThis pull request is related to #5356, implementing `<AsyncLoad />`, but leveraging a new [Babel plugin `transform-wpcalypso-async`](https://github.com/Automattic/babel-plugin-transform-wpcalypso-async) to handle transformations of prop values under the hood to `require.ensure` or `require` depending on the current environment configuration.\r\n\r\nThe new transform plugin also exposes a lower-level `asyncRequire` function for general usage. See [plugin documentation](https://github.com/Automattic/babel-plugin-transform-wpcalypso-async) for more information.\r\n\r\n__Testing Instructions:__\r\n\r\nNavigate to the editor, verifying that the sharing accordion is displayed after visiting the page.\r\n\r\n1. Navigate to the [post editor](http://calypso.localhost:3000/post)\r\n2. Select a site, if prompted\r\n3. Note that a Sharing accordion appears in the sidebar\r\n\r\n__Follow-up Tasks:__\r\n\r\nWe should improve `<AsyncLoad />` to accept additional props to control when the module is required, so that we can load in response to specific interactions (e.g. hovering the accordion title).\r\n\r\ncc @mtias @ehg @mcsf @seear @umurkontaci "},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/252656949","html_url":"https://github.com/Automattic/wp-calypso/pull/8544#issuecomment-252656949","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8544","id":252656949,"user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T15:30:25Z","updated_at":"2016-10-10T15:30:25Z","body":"- I found that you can reference Babel plugins via local file paths, so I decided to bring the plugin inside the project (at least for faster iterations in this branch).\r\n- My hacky workaround for the Mocha tests issue is to enhance the Babel plugin to strip the loader syntax from the import path (e279107), at which point Mocha will treat it as a synchronous require. I think a long-term solution would be to run modules through Webpack before passing them to Mocha, which would be more aligned with our generated bundles."}}
{"actor":{"display_login":"aduth"}}