New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react hmr example #25
Comments
Created #30 because I also wanted to see this. |
@cmoad I managed to get it working in my setup. You may take a look at it here: https://github.com/dKab/recipy-book |
@dKab wonderful! could I link to your project in koa-webpack's README? |
@shellscape sure, no problem. Thanks for the package by the way. |
Perhaps I'm misunderstanding, but I don't see that you are hot reloading the server code. I'm trying to setup a project with only server code (no react). I also see in your readme:
|
Oops. Sorry. I din't know hmr can can be applied to server code as well as to client. |
Perhaps it can't and that's why I am struggling. |
But I don't I think I grasp the concept of hmr on the server. On the client it's pretty clear - bundle is updated on the fly and thus you don't have to reload the browser to see changes. On the other hand what would be the idea of hmr on the server side? I mean why the solution when you track changes in source files and recompile server bundle and restart node with new bundle wouldn't work for you? To achieve this you could (assuming you use webpack for budling server code) start webpack in watch mode and use something like nodemon to restart your server script when bundle is changed. Or am I missing something? |
From webpack-hot-middleware's readme:
That links to the HMR API which to me reads that it's only concerned with client-side things, as that's webpack's targeted focus. The suggestion by @dKab sounds like a winner. But server-side module reloading may be out of scope for this module, given the client-side focus. It sounds like something that needs to work externally in conjunction with koa-webpack. |
Note: the linked example abandoned koa-webpack, claiming it was broken: dKab/recipe-book@701deac |
@bryanlarsen that's humorous, but thank you for sharing for the benefit of others. closing this issue as it's pretty stale. we'll welcome contributed examples for different platforms (like React) but it's not something that's a priority at the moment. |
Was anyone able to reproduce a public working example with react? |
I have React hot loading working with |
I'd love to see working example of koa-webpack with webpack 2 and react-hot-loader3
The text was updated successfully, but these errors were encountered: