-
Notifications
You must be signed in to change notification settings - Fork 54
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
Transform signature #813
Comments
Thanks for writing up the suggestion! I've thought about a very similar idea for some time, but haven't had the time to explore it yet. Essentially every asset in the graph would carry some representation of its "lineage" that would both be cheap to compute (ie. shouldn't require computing a hash after each step), and capture everything that was done to it, including the involved module versions etc. I was mostly thinking about incremental builds, where leaving a serialized version of that structure would make it possible to use a folder containing a previous build as a "cache" when rebuilding -- but it would probably work fine for "watch mode" like tools as well. I have a hunch that it would be possible to keep the core AssetGraph class ignorant about this and implement the tracing engine by wrapping a |
Yes, that's exactly how |
@davej, I think getting it to work in the general case is an "XL task", so it might take some time to get there. I think it would be a great pilot project to do it externally for |
Following on from talk in #810 about properties that describe transforms to be performed.
What do you think of having a property on the asset that tracks transforms by building a transform signature?
I used this in Pingy to avoid doing unneeded compilation, minification, autoprefixing and templating. The basic formula is that if the input file(s) is/are the same, the transform signature is the same and the existing output file is the same then I avoid the work and just leave the existing version of the output file in place. I was able to achieve ~1 second build times on a project that was taking nearly a minute without this feature.
My transform signatures were strings that looked like this:
"node-sass@4.5.2::autoprefixer@7.1.6=last 2 versions::map::minify@4.18.1"
, but there is a probably a nicer way to do it if given some thought. The entire data structure for an output file in Pingy looked like below, but I am only suggesting that assetgraph would keep a transform signature.The text was updated successfully, but these errors were encountered: