-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Question] Install bower (hence npm) to manage JS dependencies installation #67
Comments
This looks interesting. I haven't looked at doing JS dependencies at all in the ruby buildpack. How many deps are you typically pulling in? What does it look like when we don't run bower install? You just have to vendor them into your git repo? |
I'd say a dozen.
Sprockets fails to run and raises an exception in development. The assets would not precompile in production. So things will look pretty bad.
So // .bowerrc
{
"directory": "app/assets/javascripts/vendor/components",
"json": "app/assets/javascripts/component.json"
} The # .gitignore
app/assets/javascripts/vendor/components And the // app/assets/javascripts/component.json
{
"name": "My App",
"version": "1.0.0",
"dependencies": {
"jquery" : "1.8.3",
"jquery-ui" : "1.9.1",
"modernizr" : "2.6.2",
"select2" : "release-2.1",
"bootstrap" : "2.1.1",
"h5Validate" : "latest",
"spin.js" : "latest",
"bootstrap-datepicker" : "latest",
...
}
} Running Lately Sprockets learned how to talk to Don't hesitate to ask more questions, I'll make myself available. I can't use Heroku on those projects where I use Memory muscle makes it easy to type Thanks for considering this issue! 👍 |
I too am looking for a way to use Keeping potentially huge JS/CSS projects out of version control would be a huge win in noise reduction and maintainability. The only downside if that it would make for slower deployments, since you'd download Still think it would be worthwhile. |
I did a quick hack to use bower for my sinatra app. Along with your component.json, added a Rakefile:
And a package.json:
I know it is a very dirty hack, but it does work for me. |
@hiroshi interesting workaround. Do you have any idea to define a prerequisite for |
@rhacker try this. task "bower_install" do
...
end
task "assets:precompile" => "bower_install" |
@hiroshi thanks for the suggestion. I will try and reply after that :) |
FYI: I created dirty hacked buildpack with node-0.10.3. Repo: https://github.com/qnyp/heroku-buildpack-ruby-bower |
@juno |
😍 |
would have needed this as well yersterday. unfortunately, the solution proposed by @hiroshi did not work for me (i tried various node versions) due to a bug in an npm-library (i suspect). but this would definitely be nice to have! |
The most composable solution here would be to use the multi-buildpack and run node to install JS dependencies and the the ruby buildpack. If we're doing something that will now allow that from happening let us know. Right now it is not the usual case that a ruby app needs |
Interestingly enough, JS dep management is coming for Rails 4.1, so we On Wed, Sep 25, 2013 at 1:25 PM, Richard Schneeman <[email protected]
|
@hone that's interesting! do you know any details or did i miss a blog post announcing the plan? |
@hone couldn't find any details on JS dep management either. Any links / commits as pointers? |
I only heard this in conversation, so I don't have any links :( On Thu, Oct 10, 2013 at 12:04 AM, Ken Ip [email protected] wrote:
|
+1 Having the same problem with missing bower :-( |
Opened #392 to discuss this, since this issue is fairly dated. |
In all recent projects, I am using
bower
to organize and install JS dependencies.The strategy is to put all those dependencies in a git-ignored folders and let Sprockets find those dependencies.
Do you think it would be worth/sensible adding a new step when building Rails 3+ apps that would run
bower install
(right afterbundle install
) automatically so that the deps are part of the compiled container? Is there another way to approach this problem that I'm missing?Thanks in advance and thanks for your awesome work!
The text was updated successfully, but these errors were encountered: