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

Feature: target destination option for the install generator #459

Closed
aCandidMind opened this issue Jun 21, 2016 · 3 comments
Closed

Feature: target destination option for the install generator #459

aCandidMind opened this issue Jun 21, 2016 · 3 comments
Assignees

Comments

@aCandidMind
Copy link

aCandidMind commented Jun 21, 2016

First of all thanks for what appears to be an excellent gem (we're just starting with it) which is properly documented (huge plus)!

For context: Our admin backend is an engine living in a separate subfolder. After using the install generator react_on_rails:install I had to do several things to configure react_on_rails to use the backend subfolder instead of RAILS_ROOT.

I must admit, I'm not 100% sure whether things wouldn't be all along smoother for react_on_rails and other gems if we were to add them to the Gemfile of the backend subfolder instead of to the one in RAILS_ROOT. But I haven't had time to figure this out yet.

Running the install generator inside of the subfolder doesn't work for us, because then a lot of other relative paths would need to be adjusted. Currently we're running tasks, generators, etc. from RAILS_ROOT.

Here's what I had to do:

  1. Delete the created app/assets/javascripts/application.js file and move the one new line in it to the appropriate file in the backend subfolder.
  2. Move the hello world controller and view to the backend subfolder.
  3. Change output.path in client/webpack.config.js to include that subfolder.
  4. Change the assets initializer path
  5. Change config.generated_assets_dir in the react_on_rails initializer.
  6. Move the hello world route from the routes file in RAILS_ROOT to the one in the backend subfolder.
  7. Change ignore path in .gitignore
  8. Change cleanup path in Procfile.dev

This isn't important stuff, the things that need to be changed are still reasonable, but a target option changing essentially the root directory for the generator accelerates startup and might prevent initial debugging of what's not working.

@justin808
Copy link
Member

@aCandidMind It would be awesome to get a sample repo of using React on Rails as an engine, with some doc additions. If you'd like to create a PR to set the target directory for the generator, please chat with @jbhatab as he's maintaining the generator.

@jbhatab
Copy link
Member

jbhatab commented Jul 8, 2016

@aCandidMind I'm working on the component generator for now but this might be a nice feature to add. Do you think you could make a PR for this by adding an option of the target folder? I'm up to talk things out if you ever get a chance.

Appreciate the detailed breakdown.

@justin808
Copy link
Member

@aCandidMind Is this one still worth doing?

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

No branches or pull requests

3 participants