{"action":"created","issue":{"url":"https://api.github.com/repos/flowtype/flow-bin/issues/42","repository_url":"https://api.github.com/repos/flowtype/flow-bin","labels_url":"https://api.github.com/repos/flowtype/flow-bin/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/flowtype/flow-bin/issues/42/comments","events_url":"https://api.github.com/repos/flowtype/flow-bin/issues/42/events","html_url":"https://github.com/flowtype/flow-bin/pull/42","id":171096049,"number":42,"title":"[RFC] Bundle flow versions instead of post-install downloading","user":{"login":"zertosh","id":830952,"avatar_url":"https://avatars.githubusercontent.com/u/830952?v=3","gravatar_id":"","url":"https://api.github.com/users/zertosh","html_url":"https://github.com/zertosh","followers_url":"https://api.github.com/users/zertosh/followers","following_url":"https://api.github.com/users/zertosh/following{/other_user}","gists_url":"https://api.github.com/users/zertosh/gists{/gist_id}","starred_url":"https://api.github.com/users/zertosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zertosh/subscriptions","organizations_url":"https://api.github.com/users/zertosh/orgs","repos_url":"https://api.github.com/users/zertosh/repos","events_url":"https://api.github.com/users/zertosh/events{/privacy}","received_events_url":"https://api.github.com/users/zertosh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flowtype/flow-bin/labels/CLA%20Signed","name":"CLA Signed","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-08-15T02:04:21Z","updated_at":"2016-09-03T00:52:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/flowtype/flow-bin/pulls/42","html_url":"https://github.com/flowtype/flow-bin/pull/42","diff_url":"https://github.com/flowtype/flow-bin/pull/42.diff","patch_url":"https://github.com/flowtype/flow-bin/pull/42.patch"},"body":"\r\n### Why do this?\r\n\r\n* Zero dependencies.\r\n* No download = no firewall issues.\r\n* Ability to check into VCS without leaving other platforms out.\r\n* `post-install` scripts are security liability.\r\n  - Some people disable them with the `ignore-scripts` option, so to install `flow-bin` you have to make an exception for all of `flow-bin`'s dependencies. Or, manually trigger it after installing.\r\n\r\n### Considerations\r\n\r\nBundling Mac, Linux, and Windows in the same package, is only 4MB larger than the current distribution when installed using npm3. However, when installed with npm2, it is 4MB smaller.\r\n\r\n```sh\r\n# Current (npm2)\r\n\r\n$ time npm2 install flow-bin\r\nnpm-2 install flow-bin  11.27s user 3.97s system 101% cpu 14.957 total\r\n$ du -d 1 -h\r\n23M     ./node_modules\r\n\r\n# Current (npm3)\r\n\r\n$ time npm3 install flow-bin\r\nnpm3 install flow-bin  7.34s user 1.68s system 34% cpu 26.131 total\r\n$ du -d 1 -h\r\n15M     ./node_modules\r\n\r\n# Bundling (npm3)\r\n\r\n$ npm pack\r\n$ du -d 1 -h\r\n6.2M     flow-bin-0.30.0.tgz\r\n$ time npm3 install ~/src/flow-bin/flow-bin-0.30.0.tgz\r\nnpm3 install ~/src/flow-bin/flow-bin-0.30.0.tgz  1.28s user 0.31s system 123% cpu 1.290 total\r\n$ du -d 1 -h\r\n19M     ./node_modules\r\n```\r\n\r\nWhat's actually included?\r\n\r\n```\r\n274B ./node_modules/SHASUM256.txt\r\n597B ./node_modules/cli.js\r\n4.9M ./node_modules/flow-linux64-v0.30.0/flow\r\n6.1M ./node_modules/flow-osx-v0.30.0/flow\r\n8.4M ./node_modules/flow-win64-v0.30.0/flow.exe\r\n768B ./node_modules/index.js\r\n1.5K ./node_modules/license\r\n740B ./node_modules/package.json\r\n706B ./node_modules/readme.md\r\n```\r\n\r\nInstalling the bundled version *should* also be considerably faster (on a fast connection). `npm install` spends a lot of time tracing dependencies and resolving versions. A single tarball installs much faster than a lot of small ones.\r\n\r\nThe currently distributed flow binaries ship with debug symbols. Stripping them before publishing puts the bundle size on-par with the current version:\r\n\r\n```\r\n# before\r\n4.9M flow-linux64-v0.30.0/flow\r\n6.1M flow-osx-v0.30.0/flow\r\n\r\n# after\r\n3.7M flow-linux64-v0.30.0/flow\r\n3.7M flow-osx-v0.30.0/flow\r\n```\r\n\r\n### How would releases work?\r\n\r\nDocumentation is not included in this PR - that includes release instructions. I'll do that if the reception of this PR is positive. But I'm thinking something like this:\r\n\r\n1. Bump the `package.json`, since that's where the flow version comes from.\r\n2. Run `./prepare.sh && npm test`.\r\n3. Maybe do a quick file inspection?\r\n4. Commit the new `SHASUM256.txt` generated by `prepare.sh` and `package.json`. The `SHASUM256.txt` is for other tools that may want to verify the integrity of the bins (like Nuclide). May want to also have a signed version.\r\n5. `npm publish`\r\n\r\nPersonally, I think bins should be checked into github, but this PR leaves them out because that's contentious.\r\n\r\nThoughts?\r\n"},"comment":{"url":"https://api.github.com/repos/flowtype/flow-bin/issues/comments/244516930","html_url":"https://github.com/flowtype/flow-bin/pull/42#issuecomment-244516930","issue_url":"https://api.github.com/repos/flowtype/flow-bin/issues/42","id":244516930,"user":{"login":"gabelevi","id":1887264,"avatar_url":"https://avatars.githubusercontent.com/u/1887264?v=3","gravatar_id":"","url":"https://api.github.com/users/gabelevi","html_url":"https://github.com/gabelevi","followers_url":"https://api.github.com/users/gabelevi/followers","following_url":"https://api.github.com/users/gabelevi/following{/other_user}","gists_url":"https://api.github.com/users/gabelevi/gists{/gist_id}","starred_url":"https://api.github.com/users/gabelevi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabelevi/subscriptions","organizations_url":"https://api.github.com/users/gabelevi/orgs","repos_url":"https://api.github.com/users/gabelevi/repos","events_url":"https://api.github.com/users/gabelevi/events{/privacy}","received_events_url":"https://api.github.com/users/gabelevi/received_events","type":"User","site_admin":false},"created_at":"2016-09-03T00:52:53Z","updated_at":"2016-09-03T00:52:53Z","body":"I'm about to publish a new flow-bin, so I'm going to merge this and then tweak things myself :)"}}
{"actor":{"display_login":"gabelevi"}}