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

Have generator create application.js file if not found #108

Merged
merged 1 commit into from
Nov 23, 2015

Conversation

robwise
Copy link
Contributor

@robwise robwise commented Nov 20, 2015

Fixes #78
Generator used to put a setup error message when it did not find
application.js. Now, it will simply just create one with the
necessary data in it.

else
puts_setup_file_error("#{application_js} or #{application_js}.coffee", data)
create_file(app_js_path, data << "\n\n//= require turbolinks\n\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add turbolinks? It's not a requirement of react_on_rails. We support it, but don't necessarily encourage it.

I'd say remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justin808 roger that, makes sense

@robwise
Copy link
Contributor Author

robwise commented Nov 23, 2015

@justin808 this should be good to go pending a final review

@justin808
Copy link
Member

@robwise This looks fine so long as it's well tested. Let me know and I'll merge.

@justin808 justin808 added this to the 1.1 milestone Nov 23, 2015
@robwise
Copy link
Contributor Author

robwise commented Nov 23, 2015

@justin808 yep, the important part of the associated test is here: https://github.com/shakacode/react_on_rails/pull/108/files#diff-dd34ce0d9a02be7e957b081e5d11cb7cR146 since it doesn't create an existing application.js like it usually does, and yet the file still shows up as expected as running the generator.

@robwise robwise force-pushed the application-js-fix branch 2 times, most recently from a21916d to c6d122e Compare November 23, 2015 23:18
Fixes #78
Generator used to put a setup error message when it did not find
application.js. Now, it will simply just create one with the
necessary data in it. Note that we don't generate a turbolinks
sprockets requirement if we create the file for the user since
this is not really related to implementing React on Rails.
Users should add this manually if they want turbolinks.
robwise added a commit that referenced this pull request Nov 23, 2015
Have generator create application.js file if not found
@robwise robwise merged commit c21012a into master Nov 23, 2015
@robwise robwise deleted the application-js-fix branch November 23, 2015 23:41
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

Successfully merging this pull request may close these issues.

None yet

2 participants