Naive attempt at keeping crc cache around between runs#28
Naive attempt at keeping crc cache around between runs#28evs-chris wants to merge 1 commit intogobblejs:masterfrom
Conversation
|
@evs-chris did you mean to close this? Seems worth following up |
|
Yeah. I don't think keeping the .cache around is the best approach. I ran with it for a little while, and it caused some weirdness here and there. After pondering a bit, I think a better approach is:
I think with this, directory transforms could possibly also opt in to crc tracking to make skipping directory transforms possible. |
|
I've pondered this a bit more, and when I get some breathing room (probably a month or three), I'll try roughly this:
That would open up an avenue for directory transformers to take advantage of caching if they so desired. It would also open up some possibilities for non-source-transforming code to run with input into the build process. It's also pretty easy to write an observer that just dumps its input files to an external directory for inspection. The basis for my line of thought here is that the observer is the simplest unit of action rather than the transform. Does any of that sound at all reasonable? |
|
It sounds more than reasonable. I ported everything to ES6 recently (because Babel has spoiled me, and my fingers can no longer bear to write code that Node understands natively) but didn't change the architecture in any fundamental way, because I wasn't sure I could see a clear path. But I think this ('the observer is the simplest unit of action') could be that path. With fast cold builds and non-transforming observer nodes, I think we go from 'broccoli, but with a nicer API and more Windows bugs' to something that genuinely fills an underserved niche. |
I needed a good distraction for an hour or two, so I thought I'd take a swing at #25. It did knock a "cold" build of Ractive from ~15 seconds to ~4 on my machine. I feel like I shouldn't make gobble keep .cache directories around, but without a bigger refactor than I'm capable of at this point, I couldn't see a way around it.
Anyways, I figure this is at least a fair proof of concept.