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

Last sprockets changes #9

Closed
route opened this issue May 12, 2012 · 11 comments
Closed

Last sprockets changes #9

route opened this issue May 12, 2012 · 11 comments

Comments

@route
Copy link

route commented May 12, 2012

After discussing on this PR #4 I've started to work on integration last sprockets changes to sprockets-rails and I have a question. Do you know will it rails/rails#5379 be merged to rails/master? Because now sprockets only have a task for generation digest assets and we need workaround it. I've a bit adapted sprockets rake task now but work is going on.

@rafaelfranca
Copy link
Member

I don't know about the Rails pull request but we are trying to make it runs in the same process. See #8.

@drogus
Copy link
Member

drogus commented May 12, 2012

@rafaelfranca skipping nondigest would be nice anyway if someone does not need this version. Ideal solution would be to allow to write both versions on the same run, but for now this seems like a nice way to make the process faster.

@guilleiguaran
Copy link
Member

I think @route is talking about some changes done in sprockets in the last months and how we are duplicating some new features of sprockets in sprockets-rails (compilation task, manifest generation, ...) and missing others (sprockets task can be keep a specific number of old version of assets)

The problem with the Rake::SprocketsTask shipped with sprockets is that only generate digested version of assets, but probably is lot faster than the task that we are shipping with sprockets-rails

@guilleiguaran
Copy link
Member

@route @drogus What do you think about create the precompile task using Rake::SprocketsTask to generate digested asset and add a post-processing step in sprockets-rails to generate undigested files from digested one?

I don't want to add another config option to decide if we should compile undigested or not, the amount that we have right now is high already and I'm planning add a config.assets.keep with the number of versions to keep of old assets

Something like this:

Compile digested files:

bundle exec rake assets:precompile

Compile digested and undigested files:

bundle exec rake assets:precompile:both

@drogus
Copy link
Member

drogus commented May 13, 2012

@guilleiguaran this seems like a nice idea, have you checked what's the difference in time of running both versions? (Rake::SprocketsTask and rails' version)

@route
Copy link
Author

route commented May 13, 2012

Yea but I feel confusion with task naming if we will be using pure Rake::SprocketsTask
When it:

Rake::SprocketsTask.new do |t|
  t.environment = Sprockets::Environment.new
  t.output      = "./public/assets"
  t.assets      = %w( application.js application.css )
end

Then we have these tasks

rake assets          # Compile assets
rake clean_assets    # Clean old assets
rake clobber_assets  # Remove all assets

When it:

namespace :assets do
  Rake::SprocketsTask.new(:precompile) do |t|
    t.environment = Sprockets::Environment.new
    t.output      = "./public/assets"
    t.assets      = %w( application.js application.css )
  end
end

Then we have these tasks

rake assets:clean_precompile    # Clean old precompile assets
rake assets:clobber_precompile  # Remove all precompile assets
rake assets:precompile          # Compile precompile assets

@route
Copy link
Author

route commented May 13, 2012

Another issue with manifest file, sprockets place it in the output directory but rails has a separate option that can point to another directory than output.

@route
Copy link
Author

route commented May 15, 2012

@guilleiguaran @josevalim Could you explain a bit why we need manifest option in rails? We can do exactly as sprockets do and just place it in assets precompile directory or maybe I missed something.

@guilleiguaran
Copy link
Member

@route you're right, we can do exactly as sprockets. I think that we can remove the manifest path option in the next version of Rails

@route
Copy link
Author

route commented Aug 11, 2012

I'll provide a PR

@josh
Copy link
Contributor

josh commented Oct 18, 2012

Yup yup, using sprockets Manifest and Task now.

@josh josh closed this as completed Oct 18, 2012
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

5 participants