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

Switching branches in git causes multiple builds #3077

Closed
zachleat opened this issue Oct 24, 2023 · 3 comments
Closed

Switching branches in git causes multiple builds #3077

zachleat opened this issue Oct 24, 2023 · 3 comments
Labels

Comments

@zachleat
Copy link
Member

Not sure if this is a docs issue or a code issue (I’d prefer to fix in code!)

With --incremental:

image

Without --incremental:

image

Usually we’ll recommend something like eleventyConfig.setWatchThrottleWaitTime(500); https://www.11ty.dev/docs/watch-serve/#add-delay-before-re-running but that doesn’t seem to be working here either.

Desired behavior: one build!

@zachleat zachleat added the bug label Oct 24, 2023
@zachleat zachleat added this to the Eleventy 3.0.0 milestone Oct 24, 2023
@zachleat
Copy link
Member Author

Logs with eleventy-base-blog on Eleventy v2.0.1:

> [email protected] start
> npx @11ty/eleventy --serve --quiet --incremental

[11ty/eleventy-base-blog] Including drafts.
[11ty] Copied 5 files / Wrote 17 files in 0.18 seconds (10.6ms each, v2.0.1)
[11ty] Watching…
[11ty] Server at https://localhost:8080/
[11ty] File changed: content/blog/secondpost.md
[11ty] File changed: content/blog/fourthpost/fourthpost.md
[11ty] File changed: public/css/index.css
[11ty] File changed: content/blog/firstpost.md
[11ty] File changed: content/blog/thirdpost.md
[11ty] Benchmark      4ms  22%    13× (Configuration) "slugify" Nunjucks Filter
[11ty] Wrote 1 file (skipped 13) in 0.02 seconds (v2.0.1)
[11ty] Benchmark      2ms  17%    13× (Configuration) "slugify" Nunjucks Filter
[11ty] Wrote 1 file (skipped 13) in 0.01 seconds (v2.0.1)
[11ty] Copied 1 file / Wrote 0 files (skipped 14) in 0.00 seconds (v2.0.1)
[11ty] Benchmark      4ms  27%    13× (Configuration) "slugify" Nunjucks Filter
[11ty] Wrote 1 file (skipped 13) in 0.02 seconds (v2.0.1)
[11ty] Benchmark      2ms  18%    14× (Configuration) "slugify" Nunjucks Filter
[11ty] Wrote 1 file (skipped 13) in 0.01 seconds (v2.0.1)
> [email protected] start
> npx @11ty/eleventy --serve --quiet

[11ty/eleventy-base-blog] Including drafts.
[11ty] Copied 5 files / Wrote 17 files in 0.18 seconds (10.6ms each, v2.0.1)
[11ty] Watching…
[11ty] Server at https://localhost:8080/
[11ty] File changed: content/blog/thirdpost.md
[11ty] File changed: content/blog/fourthpost/fourthpost.md
[11ty] File changed: content/blog/firstpost.md
[11ty] File changed: content/blog/secondpost.md
[11ty] File changed: public/css/index.css
[11ty] Benchmark      5ms  14%    21× (Configuration) "slugify" Nunjucks Filter
[11ty] Copied 5 files / Wrote 17 files in 0.04 seconds (2.4ms each, v2.0.1)
[11ty] File changed: content/blog/fourthpost/fourthpost.md
[11ty] File changed: content/blog/secondpost.md
[11ty] File changed: content/blog/firstpost.md
[11ty] File changed: content/blog/thirdpost.md
[11ty] File changed: public/css/index.css
[11ty] Benchmark      6ms  12%    21× (Configuration) "slugify" Nunjucks Filter
[11ty] Copied 5 files / Wrote 17 files in 0.05 seconds (2.9ms each, v2.0.1)
[11ty] Benchmark     16ms  23%    21× (Configuration) "slugify" Nunjucks Filter
[11ty] Copied 5 files / Wrote 17 files in 0.07 seconds (4.1ms each, v2.0.1)

@zachleat
Copy link
Member Author

Logs with eleventy-base-blog on v3.0.0-alpha.13:

> [email protected] start
> npx @11ty/eleventy --serve --quiet --incremental

[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Copied 6 files / Wrote 16 files in 0.18 seconds (11.3ms each, v3.0.0-alpha.13)
[11ty] Watching…
[11ty] Server at https://localhost:8080/
[11ty] File changed: content/blog/firstpost.md
[11ty] File changed: content/blog/fourthpost/fourthpost.md
[11ty] File changed: content/blog/thirdpost.md
[11ty] File changed: content/blog/secondpost.md
[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Benchmark      8ms  22%     9× (Configuration) "slugify" JavaScript Function
[11ty] Wrote 2 files (skipped 11) in 0.04 seconds (v3.0.0-alpha.13)
[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Benchmark      7ms  29%     9× (Configuration) "slugify" JavaScript Function
[11ty] Wrote 2 files (skipped 11) in 0.03 seconds (v3.0.0-alpha.13)
[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Benchmark      7ms  32%    12× (Configuration) "slugify" JavaScript Function
[11ty] Wrote 2 files (skipped 11) in 0.02 seconds (v3.0.0-alpha.13)
[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Benchmark      5ms  28%     9× (Configuration) "slugify" JavaScript Function
[11ty] Wrote 2 files (skipped 11) in 0.02 seconds (v3.0.0-alpha.13)
> [email protected] start
> npx @11ty/eleventy --serve --quiet

[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Copied 6 files / Wrote 16 files in 0.23 seconds (14.4ms each, v3.0.0-alpha.13)
[11ty] Watching…
[11ty] Server at https://localhost:8080/
[11ty] File changed: content/blog/thirdpost.md
[11ty] File changed: content/blog/secondpost.md
[11ty] File changed: content/blog/firstpost.md
[11ty] File changed: content/blog/fourthpost/fourthpost.md
[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Benchmark     19ms  20%    17× (Configuration) "slugify" JavaScript Function
[11ty] Copied 6 files / Wrote 16 files in 0.09 seconds (5.6ms each, v3.0.0-alpha.13)
[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Benchmark     12ms  22%    17× (Configuration) "slugify" JavaScript Function
[11ty] Benchmark      6ms  12%     9× (Configuration) "slugify" Nunjucks Filter
[11ty] Copied 6 files / Wrote 16 files in 0.05 seconds (3.1ms each, v3.0.0-alpha.13)

@zachleat
Copy link
Member Author

This is now fixed for non-incremental builds via 65de3af:

[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Copied 6 files / Wrote 16 files in 0.18 seconds (11.3ms each, v3.0.0-alpha.14)
[11ty] Watching…
[11ty] Server at https://localhost:8080/
[11ty] File changed: content/blog.njk
[11ty] File changed: content/blog/secondpost.md
[11ty] File changed: content/blog/firstpost.md
[11ty] File changed: content/blog/fourthpost/fourthpost.md
[11ty] File changed: content/blog/thirdpost.md
[11ty] File changed: content/index.njk
[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Copied 6 files / Wrote 16 files in 0.10 seconds (6.3ms each, v3.0.0-alpha.14)
[11ty] File changed: content/blog.njk
[11ty] File changed: content/blog/secondpost.md
[11ty] File changed: content/blog/firstpost.md
[11ty] File changed: content/blog/thirdpost.md
[11ty] File changed: content/index.njk
[11ty] File changed: content/blog/fourthpost/fourthpost.md
[11ty/eleventy-img] 1 image optimized (1 deferred)
[11ty] Copied 6 files / Wrote 16 files in 0.08 seconds (5.0ms each, v3.0.0-alpha.14)

The larger issue here is that --incremental builds only support processing one template at a time in the queue. I think we can make that better, but I filed that as a new issue #3334 outside of the 3.0 milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant