-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Make task file compilation more intelligent. #927
Comments
FWIW, I'm working with @shama on creating a simple mtime-checking lib that would either work on an in-memory or filesystem-based index-of-files-to-mtimes. It would:
Possible options:
|
related implementation description from @wycats https://gist.github.com/wycats/ed9cd0d0f7ce07537e70 |
Something related we should keep on eye on is this idea: https://gist.github.com/dominictarr/5990143 For quickly comparing large file trees diffs. |
FWIW, @wycats suggested to me in IRC that my proposal here is tied to the grunt-pipeline proposal that @rpflorence linked. I'm not sure how tied-together they need to be; I think they can be 2 separate things. I understand the idea of "pipelines" vis-a-vis Grunt to be a way of simplifying task configuration so that interim file creation between tasks can be automated. Basically, I see 2 things that need to happen to make everyone happy:
@wycats @rpflorence, if my assumptions are incorrect, please correct them. I'd really like solve the "making builds faster" problem first (in a way that pipelines can use but that is not specific to pipelines), followed by the "making builds simpler to configure" problem, which I'm aware of but is a far less requested feature. |
@shama, I know you started working on a mtime-checking lib... have you made any progress on it? |
Watchify's interaction with 2 seems interesting. Watchify speeds up rebuilds on file changes by keeping the module dependency tree in memory. Building that tree from source files is expensive. We could speed up watchify / browserify startup time by writing the dependency tree to a file, but we'd need to check if any of the files has changed before we can use the file-cached dependencies. What do folks think of Grunt giving tasks the last reported dependency tree in step 1 if it has one, flagging any files that have been modified? |
+1 |
Still in que for 0.5? |
For a short-term fix, I've been using grunt-find + grunt-ttime to quickly filter a task's files to those modified since the last time the task completed. Depends on the shell find command, and configuration is a little hairy, but it's fast. |
This might be a duplicate.
This is how I see it working. When Grunt runs a task:
this.files
andthis.filesSrc
).this.files
andthis.filesSrc
to remove files that don't need to be compiled due to mtimes.Steps 2-3 could be skipped by plugins that won't have additional dependencies. Also, for plugins that might create their list of dependencies as-they-go, and not up-front, we could possibly expose the mtime-checking method behind step 3 to the task.
Steps 4-6 could be skipped by plugins that don't compile/lint or don't operate on src files.
⭐ Assuming Grunt passes in src files
src/simple.css
andsrc/has-imports.css
:The text was updated successfully, but these errors were encountered: