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
--incremental Build, only process files that have changed. #108
Comments
The really difficult part about this task is that doing it correctly would require a detailed dependency map of the content, specifically around what uses what collections. |
I believe the pug cli watch option does this. Even if included css file changes it only rebuilds templates that reference it. |
This repository is now using lodash style issue management for enhancements (see https://twitter.com/samselikoff/status/991395669016436736) This means enhancement issues will now be closed instead of leaving them open. The enhancement backlog can be found here: https://github.com/11ty/eleventy/issues?utf8=%E2%9C%93&q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc+ |
Use |
Proxies and Sorted Directed Acyclic Graphs, y’all. https://www.npmjs.com/package/toposort |
Just adding another thought: I wonder how would incremental watch mode work with a task runner like Gulp and browser sync? |
If/when this happens, it'd be great if the optimisations were available outside of watch mode. TypeScript does this via This means that users that are using different watchers would benefit from the incremental build too. |
Hm, some people referred different existing implementations. Could we gather their source code here so to lay out a plan? |
Did a really dumb/rough start of this here 6e294bd |
After working on https://www.zachleat.com/web/own-my-tweets/ I’m also thinking a nice feature might be some smarts about pagination data too, specifically adding entries into a huge paginated array would only write files for the new/changed entries. |
@matthewp had an interesting idea about reading files in the output directory to compare contents to avoid re-writing and save on rsync tasks https://twitter.com/matthewcp/status/1174013502215852032 |
…output content for the file is the same but it doesn’t seem any faster yet so 🤷♂️ #108
I did a fair bit of work to experiment playing around with @matthewp’s idea to compare output before writing is in the Hashing the content seemed to be fast enough (using Some super quick numbers (farmhash versus node’s built-in crypto module) Yeah, not writing any files did provide a small performance improvement for large projects (but at the cost of up-front hashing for the first run to create the cache file) I dunno, just not quite sold here on this yet. |
@zachleat Thanks for giving it a try! For clarity, I wasn't expecting the comparison to speed up builds, I was expecting it to speed up Out of curiosity, was this hashing implementation a separate hash file for every page, or did you concat these some how into 1 hashed file so you only need to do 1 read. From an implementation simplicity perspective you could skip the hashing and just read in the current version of the file. This would indeed be slower, but how much slower? |
Another thought about this: My specific use case: |
This feature would be awesome to have. I was thinking about how to do the dependency mapping and how it seems like each template language would need to be able to do its own map. Poking around Nunjucks docs I found the
Still gotta build up that DAG I guess, but this might be a step in the right direction, for Nunjucks anyway. |
@Ryuno-Ki Not necessarily. Jekyll does this very intelligently by only rebuilding a file under one of two conditions:
|
Really looking forward to this epic feature. I'm working with an i18n project which eventually generates 5000+ pages. That takes 15 mins to finish a build |
Isn't eleventy interested in incremental build? |
https://github.com/orgs/11ty/projects/3 lists the feature as in-progress. |
@Ryuno-Ki Oh I understood. Thank you for the guidance! As a person who develops web sites and web applications for client works, I want you to know that we can't choose eleventy for the big projects because of this. |
What a bummer! |
Actually, now that I've revisited working on migrating my site to 11ty, I'm curious: Isn't this how the |
A neat addition to this would be to have |
@j-f1 related to #108 (comment) #2456 |
@zachleat Can I use this feature for production build? I noticed that the document says: |
@rr923 Work on higher fidelity incremental builds is happening and I will likely add more issues to reflect more of the nuances but for this to offer improvements to production builds on your CI server we’ll need cold start incremental first: |
Docs updated: https://www.11ty.dev/docs/usage/incremental/ As of 2.0.0-canary.21 we’re now shipping:
Further issues have been filed for future improvements: This is finally in good enough shape that I’m ready to say that Eleventy now has incremental builds support. I’m going to milestone |
This is the step that requires knowledge of each template’s dependencies:
11ty.js
)Punt into separate issues, later:
include
or anextend
or animport
or other internal-to-template-language specific feature, how do we discover what other files consume this? Maybe no way to tell forrelative
includes that don’t live in the includes folder?The text was updated successfully, but these errors were encountered: