{"action":"opened","number":17,"pull_request":{"url":"https://api.github.com/repos/redfin/react-server/pulls/17","id":59283171,"html_url":"https://github.com/redfin/react-server/pull/17","diff_url":"https://github.com/redfin/react-server/pull/17.diff","patch_url":"https://github.com/redfin/react-server/pull/17.patch","issue_url":"https://api.github.com/repos/redfin/react-server/issues/17","number":17,"state":"open","locked":false,"title":"Add package react-server-cli, a startup script that compiles client code and starts up a server.","user":{"login":"aickin","id":44199,"avatar_url":"https://avatars.githubusercontent.com/u/44199?v=3","gravatar_id":"","url":"https://api.github.com/users/aickin","html_url":"https://github.com/aickin","followers_url":"https://api.github.com/users/aickin/followers","following_url":"https://api.github.com/users/aickin/following{/other_user}","gists_url":"https://api.github.com/users/aickin/gists{/gist_id}","starred_url":"https://api.github.com/users/aickin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aickin/subscriptions","organizations_url":"https://api.github.com/users/aickin/orgs","repos_url":"https://api.github.com/users/aickin/repos","events_url":"https://api.github.com/users/aickin/events{/privacy}","received_events_url":"https://api.github.com/users/aickin/received_events","type":"User","site_admin":false},"body":"Here's a preliminary PR that adds a separate package that contains a startup script for compiling client code and running a server. The README.md describes its goals and what it currently does, so I won't repeat that here.\r\n\r\nIf you want to see what a minimal project using `react-server-cli` looks like, check out [the hello world example](https://github.com/aickin/react-server-examples/tree/master/helloworld).\r\n\r\nA few things to note:\r\n\r\n* I decided to simplify the `routes` format a little bit, getting rid of `__LAZY_REQUIRE__` and making it more like a JSON format (although technically it's still JSON).\r\n* I think there's a good debate to be had about whether starting up a server is something that a library should do, or if every project should have its own `server.js` that instantiates Express etc. To start, I think it's probably good to run this way to ease developer pain and solve 95% of cases, but I totally understand arguments against.\r\n* It could be cleaner to have compiling client code and running a server as two separate functions that are in different packages. They do have some interdependencies, though, so it's not 100% clear to me that they can be easily split up.\r\n\r\nThere's potentially a lot of bikeshedding to do here, and I welcome it. A few topics off the top of my head:\r\n\r\n* Is `react-server-cli` even a good name? Maybe it implies (incorrectly) that it is intended to be a globally installed tool.\r\n* Should routes just be a JSON file rather than a JavaScript file? Constraining what it can do makes it much easier to compile into code splitting on the client.\r\n* Is it right to have a bin directory with an executable file?\r\n* Currently `react-server` is a peer dependency, but should it be a runtime dependency of `react-server-cli` instead?\r\n* How important is allowing customizing of webpack loaders and config? What about custom middleware for Express?\r\n\r\nI'm sure that there's more that's escaping me at the moment, and I'm sure there's lots of stuff I messed up, but rather than try and anticipate every response, let's just start the discussion. Cheers.","created_at":"2016-02-14T01:00:10Z","updated_at":"2016-02-14T01:00:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/redfin/react-server/pulls/17/commits","review_comments_url":"https://api.github.com/repos/redfin/react-server/pulls/17/comments","review_comment_url":"https://api.github.com/repos/redfin/react-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/redfin/react-server/issues/17/comments","statuses_url":"https://api.github.com/repos/redfin/react-server/statuses/61c2283a8bf7d299ca0c79d9dc577cfb0061aa22","head":{"label":"aickin:master","ref":"master","sha":"61c2283a8bf7d299ca0c79d9dc577cfb0061aa22","user":{"login":"aickin","id":44199,"avatar_url":"https://avatars.githubusercontent.com/u/44199?v=3","gravatar_id":"","url":"https://api.github.com/users/aickin","html_url":"https://github.com/aickin","followers_url":"https://api.github.com/users/aickin/followers","following_url":"https://api.github.com/users/aickin/following{/other_user}","gists_url":"https://api.github.com/users/aickin/gists{/gist_id}","starred_url":"https://api.github.com/users/aickin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aickin/subscriptions","organizations_url":"https://api.github.com/users/aickin/orgs","repos_url":"https://api.github.com/users/aickin/repos","events_url":"https://api.github.com/users/aickin/events{/privacy}","received_events_url":"https://api.github.com/users/aickin/received_events","type":"User","site_admin":false},"repo":{"id":51530923,"name":"react-server","full_name":"aickin/react-server","owner":{"login":"aickin","id":44199,"avatar_url":"https://avatars.githubusercontent.com/u/44199?v=3","gravatar_id":"","url":"https://api.github.com/users/aickin","html_url":"https://github.com/aickin","followers_url":"https://api.github.com/users/aickin/followers","following_url":"https://api.github.com/users/aickin/following{/other_user}","gists_url":"https://api.github.com/users/aickin/gists{/gist_id}","starred_url":"https://api.github.com/users/aickin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aickin/subscriptions","organizations_url":"https://api.github.com/users/aickin/orgs","repos_url":"https://api.github.com/users/aickin/repos","events_url":"https://api.github.com/users/aickin/events{/privacy}","received_events_url":"https://api.github.com/users/aickin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aickin/react-server","description":"React server monorepo","fork":true,"url":"https://api.github.com/repos/aickin/react-server","forks_url":"https://api.github.com/repos/aickin/react-server/forks","keys_url":"https://api.github.com/repos/aickin/react-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aickin/react-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aickin/react-server/teams","hooks_url":"https://api.github.com/repos/aickin/react-server/hooks","issue_events_url":"https://api.github.com/repos/aickin/react-server/issues/events{/number}","events_url":"https://api.github.com/repos/aickin/react-server/events","assignees_url":"https://api.github.com/repos/aickin/react-server/assignees{/user}","branches_url":"https://api.github.com/repos/aickin/react-server/branches{/branch}","tags_url":"https://api.github.com/repos/aickin/react-server/tags","blobs_url":"https://api.github.com/repos/aickin/react-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aickin/react-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aickin/react-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/aickin/react-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aickin/react-server/statuses/{sha}","languages_url":"https://api.github.com/repos/aickin/react-server/languages","stargazers_url":"https://api.github.com/repos/aickin/react-server/stargazers","contributors_url":"https://api.github.com/repos/aickin/react-server/contributors","subscribers_url":"https://api.github.com/repos/aickin/react-server/subscribers","subscription_url":"https://api.github.com/repos/aickin/react-server/subscription","commits_url":"https://api.github.com/repos/aickin/react-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/aickin/react-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/aickin/react-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/aickin/react-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/aickin/react-server/contents/{+path}","compare_url":"https://api.github.com/repos/aickin/react-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aickin/react-server/merges","archive_url":"https://api.github.com/repos/aickin/react-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aickin/react-server/downloads","issues_url":"https://api.github.com/repos/aickin/react-server/issues{/number}","pulls_url":"https://api.github.com/repos/aickin/react-server/pulls{/number}","milestones_url":"https://api.github.com/repos/aickin/react-server/milestones{/number}","notifications_url":"https://api.github.com/repos/aickin/react-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aickin/react-server/labels{/name}","releases_url":"https://api.github.com/repos/aickin/react-server/releases{/id}","deployments_url":"https://api.github.com/repos/aickin/react-server/deployments","created_at":"2016-02-11T17:10:56Z","updated_at":"2016-02-11T17:10:57Z","pushed_at":"2016-02-14T00:43:55Z","git_url":"git://github.com/aickin/react-server.git","ssh_url":"git@github.com:aickin/react-server.git","clone_url":"https://github.com/aickin/react-server.git","svn_url":"https://github.com/aickin/react-server","homepage":"","size":770,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"redfin:master","ref":"master","sha":"4f02e259fa166daddb48e1125a5c88fd6c12fc39","user":{"login":"redfin","id":6288468,"avatar_url":"https://avatars.githubusercontent.com/u/6288468?v=3","gravatar_id":"","url":"https://api.github.com/users/redfin","html_url":"https://github.com/redfin","followers_url":"https://api.github.com/users/redfin/followers","following_url":"https://api.github.com/users/redfin/following{/other_user}","gists_url":"https://api.github.com/users/redfin/gists{/gist_id}","starred_url":"https://api.github.com/users/redfin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redfin/subscriptions","organizations_url":"https://api.github.com/users/redfin/orgs","repos_url":"https://api.github.com/users/redfin/repos","events_url":"https://api.github.com/users/redfin/events{/privacy}","received_events_url":"https://api.github.com/users/redfin/received_events","type":"Organization","site_admin":false},"repo":{"id":51392574,"name":"react-server","full_name":"redfin/react-server","owner":{"login":"redfin","id":6288468,"avatar_url":"https://avatars.githubusercontent.com/u/6288468?v=3","gravatar_id":"","url":"https://api.github.com/users/redfin","html_url":"https://github.com/redfin","followers_url":"https://api.github.com/users/redfin/followers","following_url":"https://api.github.com/users/redfin/following{/other_user}","gists_url":"https://api.github.com/users/redfin/gists{/gist_id}","starred_url":"https://api.github.com/users/redfin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redfin/subscriptions","organizations_url":"https://api.github.com/users/redfin/orgs","repos_url":"https://api.github.com/users/redfin/repos","events_url":"https://api.github.com/users/redfin/events{/privacy}","received_events_url":"https://api.github.com/users/redfin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/redfin/react-server","description":"React server monorepo","fork":false,"url":"https://api.github.com/repos/redfin/react-server","forks_url":"https://api.github.com/repos/redfin/react-server/forks","keys_url":"https://api.github.com/repos/redfin/react-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redfin/react-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redfin/react-server/teams","hooks_url":"https://api.github.com/repos/redfin/react-server/hooks","issue_events_url":"https://api.github.com/repos/redfin/react-server/issues/events{/number}","events_url":"https://api.github.com/repos/redfin/react-server/events","assignees_url":"https://api.github.com/repos/redfin/react-server/assignees{/user}","branches_url":"https://api.github.com/repos/redfin/react-server/branches{/branch}","tags_url":"https://api.github.com/repos/redfin/react-server/tags","blobs_url":"https://api.github.com/repos/redfin/react-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redfin/react-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redfin/react-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/redfin/react-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redfin/react-server/statuses/{sha}","languages_url":"https://api.github.com/repos/redfin/react-server/languages","stargazers_url":"https://api.github.com/repos/redfin/react-server/stargazers","contributors_url":"https://api.github.com/repos/redfin/react-server/contributors","subscribers_url":"https://api.github.com/repos/redfin/react-server/subscribers","subscription_url":"https://api.github.com/repos/redfin/react-server/subscription","commits_url":"https://api.github.com/repos/redfin/react-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/redfin/react-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/redfin/react-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/redfin/react-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/redfin/react-server/contents/{+path}","compare_url":"https://api.github.com/repos/redfin/react-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redfin/react-server/merges","archive_url":"https://api.github.com/repos/redfin/react-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redfin/react-server/downloads","issues_url":"https://api.github.com/repos/redfin/react-server/issues{/number}","pulls_url":"https://api.github.com/repos/redfin/react-server/pulls{/number}","milestones_url":"https://api.github.com/repos/redfin/react-server/milestones{/number}","notifications_url":"https://api.github.com/repos/redfin/react-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redfin/react-server/labels{/name}","releases_url":"https://api.github.com/repos/redfin/react-server/releases{/id}","deployments_url":"https://api.github.com/repos/redfin/react-server/deployments","created_at":"2016-02-09T19:20:35Z","updated_at":"2016-02-13T04:24:02Z","pushed_at":"2016-02-13T07:08:07Z","git_url":"git://github.com/redfin/react-server.git","ssh_url":"git@github.com:redfin/react-server.git","clone_url":"https://github.com/redfin/react-server.git","svn_url":"https://github.com/redfin/react-server","homepage":"","size":799,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":10,"forks":6,"open_issues":10,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/redfin/react-server/pulls/17"},"html":{"href":"https://github.com/redfin/react-server/pull/17"},"issue":{"href":"https://api.github.com/repos/redfin/react-server/issues/17"},"comments":{"href":"https://api.github.com/repos/redfin/react-server/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/redfin/react-server/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/redfin/react-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/redfin/react-server/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/redfin/react-server/statuses/61c2283a8bf7d299ca0c79d9dc577cfb0061aa22"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":651,"deletions":0,"changed_files":13}}