Skip to content

Conversation

guzart
Copy link
Contributor

@guzart guzart commented Mar 9, 2016

This allow to use react-rails without sprockets. User can use their own renderer without the need for sprockets.

This was a quick proof of concept, please let me know what would you like the style code to be.

@rmosolgo
Copy link
Member

rmosolgo commented Mar 9, 2016

I like this idea, I think it would go well with #427 ! Your code style is fine by me.

One question: how can we be sure to keep maintaining this in the future? Can we test somehow that react-rails still works in environment without sprockets?

@guzart
Copy link
Contributor Author

guzart commented Mar 10, 2016

I did a quick google search on how to test "railties", it seems like it's considered an integration test with Rails. Looking for examples I found that the Draper gem has an actual Rails app fixture.

I'll keep looking and thinking on how to test the conditional integration.

@rmosolgo
Copy link
Member

Yeah, I was wondering if we might be able to add an appraisal with some configuration that didn't have sprockets ... but, sprockets is a dependency of Rails (right?) so I'm not sure how customizing the gemfile could do that :S

@rmosolgo rmosolgo mentioned this pull request Apr 29, 2016
17 tasks
@rmosolgo
Copy link
Member

Just curious, how do you run Rails without Sprockets? Isn't Sprockets a dependency of Rails (via sprockets-rails?

@guzart
Copy link
Contributor Author

guzart commented Apr 29, 2016

I guess you can't help installing the gem since it's a direct dependency of the Rails gemspec.

TLDR; you remove the require "sprockets/railtie" line from your application.rb file.

When generating a site you can add the --skip-sprockets flag which generates an application.rb file with the list dependencies instead of just require "rails/all", and the require "sprockets/railtie" line is omitted.

@rmosolgo
Copy link
Member

@guzart Thanks for your work on this! I pulled your commit into #555 so I could rebase it & set up a test run without the Sprockets railtie.

@rmosolgo rmosolgo closed this Jun 27, 2016
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.

2 participants