{"action":"created","issue":{"url":"https://api.github.com/repos/redfin/react-server/issues/791","repository_url":"https://api.github.com/repos/redfin/react-server","labels_url":"https://api.github.com/repos/redfin/react-server/issues/791/labels{/name}","comments_url":"https://api.github.com/repos/redfin/react-server/issues/791/comments","events_url":"https://api.github.com/repos/redfin/react-server/issues/791/events","html_url":"https://github.com/redfin/react-server/pull/791","id":196583637,"number":791,"title":"Server Side HMR/Webpack & Other Improvements","user":{"login":"drewpc","id":1407905,"avatar_url":"https://avatars.githubusercontent.com/u/1407905?v=3","gravatar_id":"","url":"https://api.github.com/users/drewpc","html_url":"https://github.com/drewpc","followers_url":"https://api.github.com/users/drewpc/followers","following_url":"https://api.github.com/users/drewpc/following{/other_user}","gists_url":"https://api.github.com/users/drewpc/gists{/gist_id}","starred_url":"https://api.github.com/users/drewpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewpc/subscriptions","organizations_url":"https://api.github.com/users/drewpc/orgs","repos_url":"https://api.github.com/users/drewpc/repos","events_url":"https://api.github.com/users/drewpc/events{/privacy}","received_events_url":"https://api.github.com/users/drewpc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-20T04:25:50Z","updated_at":"2016-12-28T16:43:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/redfin/react-server/pulls/791","html_url":"https://github.com/redfin/react-server/pull/791","diff_url":"https://github.com/redfin/react-server/pull/791.diff","patch_url":"https://github.com/redfin/react-server/pull/791.patch"},"body":"This PR covers a number of things that are outlined below.  I'm pretty much at a stopping point where I need some assistance from others.  The unchecked items are things that aren't working/implemented and I would love some assistance.  Feedback on everything would be great.\r\n\r\n- [x] Combined the JS and HTML servers into one.  Now, there is a single ExpressJS server created and `webpack-dev-middleware` is added to it only if the server is started with `hot: true`\r\n- [x] Removed entries throughout the application for `jsPort` since it is no longer required.\r\n- [x] The default jsUrl is now `/` instead of `http[s]?://{host}:{jsPort}`.  This makes loading the assets cleaner because the URL is relative instead of absolute.\r\n- [x] Created two Webpack compiler paths: client and server bundles.  Both outputs live in __clientTemp to prevent breaking existing applications.  This covers issues: #773, #759, #649, #622, and #595 \r\n- [x] Enabled hot module reload of server-side assets after they are compiled by Webpack.  Discussed in issue #773.\r\n- [x] Added an example showing some of these features.\r\n- [x] The server watches for changes in `.reactserverrc`, `routes.js[on]`, and any custom webpack configs.  If any of those files change, the server restarts itself.  Other files that change just cause a recompile by Webpack.\r\n- [x] Added a `compileOnStartup` option to `.reactserverrc` that allows you to disable compilation when starting the server.  Discussed in #773.\r\n- [x] Some of the modules installed in `node_modules` are being bundled into the server side Webpack config instead of left out.  I need help tracking down where/why this is happening because I have the node modules all listed as externals in the Webpack config. UPDATE (12/26/2016): fixed \r\n- [ ] Server-side chunking isn't working properly.  For some reason, I can't get any of the existing/previous manifest stuff to work properly and I need to discuss how all of this is supposed to work with someone.  @jhnns - can you help with this?  UPDATE (12/26/2016): spent ~6 hours working on this and it seems that chunked code being bundled for Node with a libraryTarget of 'commonjs2' sets module.exports but it sets it to an array like this: [2] (the chunk ID).  It doesn't actually export any of the module code, therefore the bundle can't be imported.  If I limit the number of chunks to 1 and disable a common chunk, modules.exports is set to the webpackBootstrap function itself.\r\n- [ ] Some of the tests are blowing up and I don't understand how they are working.  Can someone help me look into this?  UPDATE (12/27/2016): Fixed most of the test issues, but running across one last one that I don't understand:\r\n\r\n```\r\n[16:54:49] Starting 'test'...\r\n.......................................................................................................\r\n/react-server/packages/react-server/target/server/util/util/PageUtil.js:238\r\n// page methods.\r\n^\r\nError: RLS() access outside of request!\r\n    at /react-server/node_modules/request-local-storage/lib/server/index.js:26:35\r\n    at Object.<anonymous> (/react-server/packages/react-server/target/server/util/util/PageUtil.js:238:1)\r\n    at Object.setRequest (/react-server/packages/react-server/target/server/util/util/PageUtil.js:338:2)\r\n    at Navigator.handlePage (/react-server/packages/react-server/target/server/context/context/Navigator.js:199:4)\r\n    at Timeout.<anonymous> (/react-server/packages/react-server/target/server/context/Navigator.js:251:21)\r\n    at Timeout._onTimeout (/react-server/node_modules/async-listener/glue.js:188:31)\r\n    at ontimeout (timers.js:365:14)\r\n    at tryOnTimeout (timers.js:237:5)\r\n    at Timer.listOnTimeout (timers.js:207:5)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/redfin/react-server/issues/comments/269503546","html_url":"https://github.com/redfin/react-server/pull/791#issuecomment-269503546","issue_url":"https://api.github.com/repos/redfin/react-server/issues/791","id":269503546,"user":{"login":"roblg","id":777138,"avatar_url":"https://avatars.githubusercontent.com/u/777138?v=3","gravatar_id":"","url":"https://api.github.com/users/roblg","html_url":"https://github.com/roblg","followers_url":"https://api.github.com/users/roblg/followers","following_url":"https://api.github.com/users/roblg/following{/other_user}","gists_url":"https://api.github.com/users/roblg/gists{/gist_id}","starred_url":"https://api.github.com/users/roblg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roblg/subscriptions","organizations_url":"https://api.github.com/users/roblg/orgs","repos_url":"https://api.github.com/users/roblg/repos","events_url":"https://api.github.com/users/roblg/events{/privacy}","received_events_url":"https://api.github.com/users/roblg/received_events","type":"User","site_admin":false},"created_at":"2016-12-28T16:43:18Z","updated_at":"2016-12-28T16:43:18Z","body":"@drewpc sorry for the delay getting to this. I got sick right before Christmas and wasn't in any shape to think :(\r\n\r\nThis looks really good. I'm taking it for a spin right now, and I might have more feedback, but overall I'm really excited.\r\n\r\nre: @jhnns 's suggested architecture -- that architecture looks _eerily_ similar to what Redfin is using internally right now (our internal build predates the `react-server-cli` package), and I'm pretty confident that getting Redfin onto `react-server-cli` would require a similar architecture. I also hadn't seen `happypack` before -- I'm going to try that out internally and see if it can't solve some other problems we've been having :grin:\r\n\r\nI'm curious to hear @gigabo's thoughts as well, but I think I'm OK merging this first (when it's ready), and then @jhnns (or whoever) can submit a patch for the proxy/separate process architecture at some point in the future. The main downside I see to that is that there's a little bit of back-and-forth code shuffling around webpack-dev-middleware vs. webpack-dev-server, and we need to solve the chunk manifest thing, but the upside is better support for hot reload in the meantime.\r\n\r\nThoughts? "}}
{"actor":{"display_login":"roblg"}}