busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

ramp-resources doesn't reuse unchanged compiled files #305

Open jodal opened 12 years ago

jodal commented 12 years ago

ramp-resources doesn't reuse unchanged compiled files, so buster-coffee causes all files to becompiled on every test run. We discussed this on IRC in August, but we never resolved this:

2012-08-15 15:54:32     jodal   cjno: compiling my set of coffee files takes
    ~1200ms every time I run `buster test`. where should I start looking to
    understand how to make buster only recompile files not already
    compiled and cached at the captured browsers? I assume somewhere
    in ramp-resources?
2012-08-15 16:51:10     jodal   cjno: so far I've figured out that my
    compiled js resources didn't have the etag set, so now I'm copying the
    etag from the original .coffee resource to the compiled .coffee.js
    resource
2012-08-15 16:51:49     jodal   doens't reduce the time spent compiling,
    though, but http://localhost:1111/resources now lists the .coffee.js
    files
2012-08-16 08:34:52     cjno    jodal: hmm, I have to look into that
2012-08-16 08:35:02     cjno    jodal: possibly this is because the
    resources change names?
2012-08-16 09:33:27     jodal   cjno: they have the same name every time,
    e.g. name from the file system + ".js"
2012-08-16 09:34:16     cjno    yeah, but the input file is named different
    from the output file, right?
2012-08-16 11:46:28     jodal   cjno: before buster-coffee runs, the
    resourceset got e.g. foo.coffee, and it's in the loadpath. after
    buster-coffee runs, the resourceset got foo.coffee and foo.coffee.js,
    but only foo.coffee.js in the loadpath. the etag of foo.coffee is copied
    onto foo.coffe.js so that the compiled resource has an etag that only
    changes when the source file changes.
2012-08-16 12:29:11     cjno    jodal: I just wonder if Buster sees that
    the *.js file is not compiled, and
2012-08-16 12:30:00     cjno    jodal: I will have to investigate tonight
2012-08-16 12:31:19     jodal   note that the last buster-coffee release
    doesn't set the etag. I changed that in git only yesterday

The etag fix in buster-coffee is still unreleased, but as mentioned, it doesn't seem to be enough to resolve this issue.

cjohansen commented 12 years ago

Hmm, was this a problem before or after I implemented the resource alternatives approach we discussed on web rebels?

jodal commented 12 years ago

This is with v0.6. I've never tried with master/v0.7. When did you implement the resource alternatives?

cjohansen commented 12 years ago

It's on master/0.7. Will ping you about it when I get it to a stage where you can play with it (the binaries are currently out of commission).

jodal commented 11 years ago

buster-coffee 0.1.4 released last week includes the ETag on compiled *.coffee.js files.

Together with Buster.JS 0.6.12 I still have 1-2 seconds of CoffeeScript compilation before every test run, even though the browser typically got N-1 up to date *.coffee.js files cached.

dkl-ppi commented 10 years ago

@jodal, has something changed with buster.js 0.7?

jodal commented 10 years ago

Not that I know of, but I don't really know, as I don't use buster-coffee myself any more.