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

Dynamic tasks make simple pipelines re-compile on subsequent runs #93

Closed
svenfuchs opened this issue Oct 6, 2012 · 6 comments
Closed

Comments

@svenfuchs
Copy link

I'm seeing stuff like this:

# with the following pipelines calling `rakep` repeatedly will re-generate output for both coffee_script 
# and minispade for all matched files over and over.
#
# when using just either the coffee_script or minispade pipeline `rakep` will only generate files once
# on repeated executions.


require 'rake-pipeline-web-filters'

output 'public/scripts'
input 'assets/scripts' do
  match '**/*.coffee' do
    coffee_script
  end

  match '**/*.js' do
    modules = proc { |input| input.path.gsub(%r((^app/|lib/|\.js$)), '') }
    minispade(string: true, rewrite_requires: true, module_id_generator: modules)
  end
end

and

# also, this compiles handlebars only once, as expected:

output 'public/scripts'
input 'assets/scripts' do
  match '**/*.hbs' do
    keyname = proc { |input| input.path.sub(%r(^app/templates/), '').sub(/\.hbs$/, '') }
    handlebars(:key_name_proc => keyname)
  end

  match '**/*.hbs' do
    concat 'templates.js'
  end
end

# while this, again, will compile handlebars over and over:

output 'public/scripts'
input 'assets/scripts' do
  match '**/*.hbs' do
    keyname = proc { |input| input.path.sub(%r(^app/templates/), '').sub(/\.hbs$/, '') }
    handlebars(:key_name_proc => keyname)
    concat 'templates.js'
  end
end

When downgrading to 3465e0e it seems to go away.

@ahawkins
Copy link

ahawkins commented Oct 7, 2012

The first examples has 2 pipelines (one to generate and another to concatenate). The second pipeline has N inputs to 1 output. (generation and concatenation all happen in the same pipeline). The issue may because by how we think caching/dirty tracking should work. @wycats: Does dirty tracking only happen at the pipeline level or does it work at the filter level as well? I'm asking because if you look at the two pipelines as a block box, in order to generate a correct output for the N -> 1 you'd have to recompile the pipeline each time any of the N files changed (as rakep doesn't have any idea what's actually happening inside the pipeline).

@wagenet
Copy link
Contributor

wagenet commented Nov 13, 2012

@twinturbo Is this still an issue?

@ahawkins
Copy link

@wagenet no it covered in the tests. You can close this one too.

@ahawkins
Copy link

@svenfuchs #117 fixes all this stuff. Have you had a change to test against current master?

@svenfuchs
Copy link
Author

not yet, sorry :/ heavily involved in other stuff these days

but i think @drogus has updated our rake-pipeline version and might have some feedback?

@wagenet
Copy link
Contributor

wagenet commented Nov 16, 2012

Assuming this is fixed by #117 then. If there are still issues, let us know.

@wagenet wagenet closed this as completed Nov 16, 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

3 participants