Skip to content
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

Generator is not creating command to start hot reloading #277

Closed
hafizio opened this issue Feb 16, 2016 · 10 comments
Closed

Generator is not creating command to start hot reloading #277

hafizio opened this issue Feb 16, 2016 · 10 comments

Comments

@hafizio
Copy link

hafizio commented Feb 16, 2016

Previously when I run rails generate react_on_rails:install. I'll have this in my Procfile.dev:

web: rails s
hot: sh -c 'cd client && npm start'
client: sh -c 'rm app/assets/javascripts/generated/* || true && cd client && npm run build:dev:client'

Now when I install again in a fresh application, the hot is missing and I have to add it manually. So running foreman start -f Procfile.dev won't start the server for hot reloading.

@justin808
Copy link
Member

@hafizio We've got plans to update the generators to match up with the https://github.com/shakacode/react-webpack-rails-tutorial/. If you or somebody you know could help with this, that would be much appreciated.

CC: @aaronvb @jbhatab

@justin808 justin808 reopened this Feb 16, 2016
@justin808
Copy link
Member

@hafizio When you say "previously", are you saying that a prior version of ReactOnRails?

@hafizio
Copy link
Author

hafizio commented Feb 16, 2016

@justin808 yes. I think before the version 3. Thank you for the quick response.

@justin808
Copy link
Member

Definitely sounds like a bit of a bug, but also something we'd need to find a volunteer to fix these generator issues.

@yorzi Any chance you might be able to help us again on the generator?

@justin808
Copy link
Member

BTW, we're thinking of removing the hot-reload webpack dev server, as the new way allows you to simply use your Rails server for hot reloading.

@jbhatab We really got to get this changed in the generators before you make your epic screencast series!

@aaronvb
Copy link
Member

aaronvb commented Feb 16, 2016

hot: is indeed missing in Procfile.dev with the base install:

https://github.com/shakacode/react_on_rails/blob/master/lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt

Looks like it was removed in 2.0

@justin808
Copy link
Member

@aaronvb We might have done this to simplify things. In general, it doesn't make sense to run more processes than you really need, as every change saved triggers lots of recompilation.

@aaronvb
Copy link
Member

aaronvb commented Feb 16, 2016

@justin808 Further investigating, we moved the command to npm run express-server

Perhaps we could update the base generator helpful message to include that command. We're only showing that command with the redux generator.

@justin808
Copy link
Member

@aaronvb Excellent idea!

@aaronvb
Copy link
Member

aaronvb commented Feb 16, 2016

@hafizio While the hot command is no longer in the Procfile, it can still be loaded with npm run express-server. Sorry for the confusion! We've updated the message after running the base generator install rails generate react_on_rails:install to provide information on running the hot reloading server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants