Skip to content
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

Adds ondemand support for serve mode #1556

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

samthor
Copy link

@samthor samthor commented Dec 16, 2020

This adds a --ondemand flag that, when combined with --watch, only builds pages which are requested. (This is basically the idea behind 11ty-fast-dev).

In our testing, this provides ~1.5x speedup on test Eleventy sites during development. If you have costly transforms or filters, it speeds it up even more (this is the case for developer.chrome.com, where we unfortunately do HTML parsing and rewriting as part of this step).

If running your templates (and their filters) or transforms has global side-effects and you reply on that during development, then this probably isn't a good idea.

Cons:

  • I'm not entirely sure how well this interacts with incremental build
  • You might want this behavior without BrowserSync (in fact, developer.chrome.com probably does, but this feature just makes sense behind --watch).

Comment on lines +815 to +816
let promise = this.writer.write();
ret = await promise;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let promise = this.writer.write();
ret = await promise;
ret = await this.writer.write();

@Ryuno-Ki
Copy link
Contributor

Any updates?

@samthor
Copy link
Author

samthor commented Feb 10, 2021

I'm waiting for input from @zachleat.

I suspect his work on #1629 might make this sort of approach easier, but I'm not sure yet.

@zachleat zachleat self-assigned this Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants