{"action":"closed","number":188,"pull_request":{"url":"https://api.github.com/repos/mapbox/batfish/pulls/188","id":144091374,"html_url":"https://github.com/mapbox/batfish/pull/188","diff_url":"https://github.com/mapbox/batfish/pull/188.diff","patch_url":"https://github.com/mapbox/batfish/pull/188.patch","issue_url":"https://api.github.com/repos/mapbox/batfish/issues/188","number":188,"state":"closed","locked":false,"title":"[WIP] Add createModernBuild option","user":{"login":"davidtheclark","id":628431,"avatar_url":"https://avatars2.githubusercontent.com/u/628431?v=4","gravatar_id":"","url":"https://api.github.com/users/davidtheclark","html_url":"https://github.com/davidtheclark","followers_url":"https://api.github.com/users/davidtheclark/followers","following_url":"https://api.github.com/users/davidtheclark/following{/other_user}","gists_url":"https://api.github.com/users/davidtheclark/gists{/gist_id}","starred_url":"https://api.github.com/users/davidtheclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidtheclark/subscriptions","organizations_url":"https://api.github.com/users/davidtheclark/orgs","repos_url":"https://api.github.com/users/davidtheclark/repos","events_url":"https://api.github.com/users/davidtheclark/events{/privacy}","received_events_url":"https://api.github.com/users/davidtheclark/received_events","type":"User","site_admin":false},"body":"Closes #183. (Also, for kicks, closes #187.)\r\n\r\nInspired by https://philipwalton.com/articles/deploying-es2015-code-in-production-today/.\r\n\r\nAdds an option `createModernBuild`, which defaults to `true`. When this mode is on, Batfish turns up the fanciness ...\r\n\r\nI'm considering a \"modern\" build one that expects the browser to support ES2015 classes and arrow functions. I was thinking that no compilation of those two features might save us a lot, considering how often they are used and how bulky the class compilation is. However, there are some other ES2015 features we might want to expect, as well, for similar reasons:\r\n\r\n- for-of\r\n- template literals\r\n- parameters (e.g. default parameters)\r\n\r\nBatfish hard-codes a `babel-preset-env` configuration that would create a build suited to browsers with the expected ES2015 features (see https://github.com/mapbox/batfish/compare/es2015-bundle?expand=1#diff-1fe5c18317c115506c68d98801aba837R17). \r\n\r\nWhen you `batfish start`, it uses that config, assuming you're going to be doing your iterative development with a modern browser. \r\n\r\nWhen you `batfish build`, Batfish builds two sets of client bundles, one for modern browsers and one for legacy browsers. (It only needs to build one static bundle still, but while investigating this I realized we can limit compilation on that static bundle to the features not available in your running version of Node.) So we end up with two copies of almost every file, the modern versions prefixed with `m-`. When we build the HTML, then, we include a runtime check for support of the ES2015 syntax we want (i.e. classes and arrow functions): if it's supported, load the modern bundles; if not, load the legacy bundles.\r\n\r\nAnother trick is that Uglify does not yet understand ES2015 syntax, so when minifying the modern bundles we need to use babel-minify, instead.\r\n\r\nI've tried this out on several examples, using IE11 as the legacy browser — and it seemed to work nicely! \r\n\r\n@jfurrow I'd love your review — affirmation that this makes, or criticism of it — before I update all the relevant tests.","created_at":"2017-10-01T22:21:38Z","updated_at":"2018-03-06T01:13:26Z","closed_at":"2018-03-06T01:13:26Z","merged_at":null,"merge_commit_sha":"1935b33f43de151715d5e36b2300907f304c94b6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/batfish/pulls/188/commits","review_comments_url":"https://api.github.com/repos/mapbox/batfish/pulls/188/comments","review_comment_url":"https://api.github.com/repos/mapbox/batfish/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/batfish/issues/188/comments","statuses_url":"https://api.github.com/repos/mapbox/batfish/statuses/947a4c8a5806828bd6820b28bcacc27c67a04039","head":{"label":"mapbox:es2015-bundle","ref":"es2015-bundle","sha":"947a4c8a5806828bd6820b28bcacc27c67a04039","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":93540067,"name":"batfish","full_name":"mapbox/batfish","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/batfish","description":"A static-site generator for highly optimized sites powered by React and Webpack.","fork":false,"url":"https://api.github.com/repos/mapbox/batfish","forks_url":"https://api.github.com/repos/mapbox/batfish/forks","keys_url":"https://api.github.com/repos/mapbox/batfish/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/batfish/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/batfish/teams","hooks_url":"https://api.github.com/repos/mapbox/batfish/hooks","issue_events_url":"https://api.github.com/repos/mapbox/batfish/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/batfish/events","assignees_url":"https://api.github.com/repos/mapbox/batfish/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/batfish/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/batfish/tags","blobs_url":"https://api.github.com/repos/mapbox/batfish/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/batfish/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/batfish/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/batfish/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/batfish/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/batfish/languages","stargazers_url":"https://api.github.com/repos/mapbox/batfish/stargazers","contributors_url":"https://api.github.com/repos/mapbox/batfish/contributors","subscribers_url":"https://api.github.com/repos/mapbox/batfish/subscribers","subscription_url":"https://api.github.com/repos/mapbox/batfish/subscription","commits_url":"https://api.github.com/repos/mapbox/batfish/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/batfish/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/batfish/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/batfish/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/batfish/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/batfish/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/batfish/merges","archive_url":"https://api.github.com/repos/mapbox/batfish/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/batfish/downloads","issues_url":"https://api.github.com/repos/mapbox/batfish/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/batfish/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/batfish/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/batfish/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/batfish/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/batfish/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/batfish/deployments","created_at":"2017-06-06T16:30:36Z","updated_at":"2018-02-20T18:16:19Z","pushed_at":"2018-03-05T23:17:04Z","git_url":"git://github.com/mapbox/batfish.git","ssh_url":"git@github.com:mapbox/batfish.git","clone_url":"https://github.com/mapbox/batfish.git","svn_url":"https://github.com/mapbox/batfish","homepage":"","size":2818,"stargazers_count":64,"watchers_count":64,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc"},"forks":5,"open_issues":16,"watchers":64,"default_branch":"master"}},"base":{"label":"mapbox:master","ref":"master","sha":"e56c4e601efaa50853d95377bc6eca06d80b7677","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":93540067,"name":"batfish","full_name":"mapbox/batfish","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/batfish","description":"A static-site generator for highly optimized sites powered by React and Webpack.","fork":false,"url":"https://api.github.com/repos/mapbox/batfish","forks_url":"https://api.github.com/repos/mapbox/batfish/forks","keys_url":"https://api.github.com/repos/mapbox/batfish/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/batfish/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/batfish/teams","hooks_url":"https://api.github.com/repos/mapbox/batfish/hooks","issue_events_url":"https://api.github.com/repos/mapbox/batfish/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/batfish/events","assignees_url":"https://api.github.com/repos/mapbox/batfish/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/batfish/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/batfish/tags","blobs_url":"https://api.github.com/repos/mapbox/batfish/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/batfish/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/batfish/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/batfish/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/batfish/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/batfish/languages","stargazers_url":"https://api.github.com/repos/mapbox/batfish/stargazers","contributors_url":"https://api.github.com/repos/mapbox/batfish/contributors","subscribers_url":"https://api.github.com/repos/mapbox/batfish/subscribers","subscription_url":"https://api.github.com/repos/mapbox/batfish/subscription","commits_url":"https://api.github.com/repos/mapbox/batfish/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/batfish/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/batfish/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/batfish/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/batfish/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/batfish/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/batfish/merges","archive_url":"https://api.github.com/repos/mapbox/batfish/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/batfish/downloads","issues_url":"https://api.github.com/repos/mapbox/batfish/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/batfish/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/batfish/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/batfish/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/batfish/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/batfish/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/batfish/deployments","created_at":"2017-06-06T16:30:36Z","updated_at":"2018-02-20T18:16:19Z","pushed_at":"2018-03-05T23:17:04Z","git_url":"git://github.com/mapbox/batfish.git","ssh_url":"git@github.com:mapbox/batfish.git","clone_url":"https://github.com/mapbox/batfish.git","svn_url":"https://github.com/mapbox/batfish","homepage":"","size":2818,"stargazers_count":64,"watchers_count":64,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc"},"forks":5,"open_issues":16,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/batfish/pulls/188"},"html":{"href":"https://github.com/mapbox/batfish/pull/188"},"issue":{"href":"https://api.github.com/repos/mapbox/batfish/issues/188"},"comments":{"href":"https://api.github.com/repos/mapbox/batfish/issues/188/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/batfish/pulls/188/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/batfish/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/batfish/pulls/188/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/batfish/statuses/947a4c8a5806828bd6820b28bcacc27c67a04039"}},"author_association":"COLLABORATOR","merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":3,"review_comments":8,"maintainer_can_modify":false,"commits":1,"additions":431,"deletions":72,"changed_files":11}}
{"actor":{"display_login":"davidtheclark"}}