bolinfest / plovr

plovr: a Closure build tool
78 stars 49 forks source link

Split path to path and cached_path. #8

Open fridek opened 11 years ago

fridek commented 11 years ago

Background: I work on a project with 150k LOC. It uses Closure and four other libraries, all compiled using plovr. SIMPLE mode output is over 6MB. When this code used to live in remote filesystem each reload would take 30-40s to recompile in SIMPLE mode. ADVANCED was even worse. We disabled all checks to make it that fast (slow) too. With code stored locally reload takes 10-15s which is closer to acceptable, but I think it could be much better if plovr would parse some of the files only once on run and then watch only those specified as not cached. In common user scenario it would allow fast linking with libraries, like I often link to latest Closure in my personal projects. In our case it would allow us to create configs for each component dev is working on with all others cached.

I think it may have some dependencies on closure compiler (can you inject the same AST into different compilation runs?). If they are not resolvable, all files marked as cached could be concated into one temporary file and processed on each run in such form.

Regarding goog.require between uncached and cached files - I think it's safe to assume that dev can reload plovr server whenever deps change. It can be also actually implemented that whenever deps change, all cache has to be purged.