question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.0.0-canary.21 in dev mode: permalinks and collections

See original GitHub issue

Operating system

macOS Ventura v.13.1 (22C65)

Eleventy

2.0.0-canary.21

Describe the bug

With Eleventy 2.0.0-canary.20, the following file…

https://github.com/brycewray/eleventy_site/blob/main/_data/eleventyComputed.js

… controls whether files have permalinks and appear in collections based on their timestamps and draft status, as I described in https://www.brycewray.com/posts/2022/12/drafts-timestamp-based-publishing-eleventy/ (earlier today). This doesn’t work fully in dev mode when --incremental is in use; it adjusts some pages but not others. I had hoped that 2.0.0-canary.21 would correct this, but I’ve found that, instead, it doesn’t work in 2.0.0-canary.21 at all, and that’s with or without --incremental. Reverting to 2.0.0-canary.20 solved the issue, but still only if --incremental is not part of the Eleventy command.

Reproduction steps

  1. Install Eleventy 2.0.0-canary.20.
  2. Add a JavaScript file to the site data directory which uses eleventyComputed (as described above) to control whether files are built and appear in collections, based on their draft status and timestamps within their respective front matter.
  3. In dev mode, run ELEVENTY_ENV=development npx @11ty/eleventy --serve. In 2.0.0-canary.20, the site respects the item from step 2. (For example: change an existing Markdown file’s timestamp to a future date and/or its draft status to true, and this should hide it by killing its permalink and removing it from collections; then revert these changes and the file should reappear.)
  4. Still in dev mode, run ELEVENTY_ENV=development npx @11ty/eleventy --serve --incremental. In 2.0.0-canary.20, the site doesn’t uniformly respect the item from step 2.
  5. Repeat step 3 and confirm that all again works as it should in 2.0.0-canary.20.
  6. Install Eleventy 2.0.0-canary.21.
  7. Repeat step 3. In 2.0.0-canary.21, the site doesn’t respect the item from step 2. (The parenthetical test example in step 3 doesn’t work.)
  8. Repeat step 4. In 2.0.0-canary.21, the site doesn’t respect the item from step 2. (The parenthetical test example in step 3 doesn’t work.)

Expected behavior

With or without --incremental in place, files should get permalinks and be in collections — or not — based on how the eleventyComputed evaluation goes. (But, even if --incremental remains problematic for the 2.0.0 canaries, the desired behavior absolutely should occur when that switch is not used.)

Reproduction URL

https://github.com/brycewray/eleventy_site

Screenshots

No response

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
zachleatcommented, Dec 22, 2022

Ah, yeah I found two regressions here, one in non --incremental builds using a template cache that they weren’t supposed to. Fixed with https://github.com/11ty/eleventy/commit/e4501e8d7e549c42df8d3de00a8d9ba37ba7c303

And more controversially, during --incremental: whether or not the cached data cascade should be used for non-matching templates. I did a commit to reset the cache for the data cascade in this scenario, I think it should likely fix your problem. https://github.com/11ty/eleventy/commit/01c1cf2160a47e1a2dbf968f3cca5e31b47d4bb1

Shipping with v2.0.0-canary.22

1reaction
brycewraycommented, Dec 22, 2022

@zachleat In case you wanted me to test 2.0.0-canary.23 as well: be advised that I just loaded it and saw the same behavior as in canary.20 and canary.22 re --incremental. Let me know if you want me to try anything else. In any event, certainly just a small concern and absolutely not worth losing any of your holidays-related time worrying about IMHO. 🎄 👪

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eleventy 2.0.0 Milestone - GitHub
Eleventy 2.0.0 Milestone · 11ty/eleventy. ... 2.0.0-canary.21 in dev mode: permalinks and collections bug feature: incremental builds.
Read more >
Edge — Eleventy
Eleventy Edge is an exciting new way to add dynamic content to your Eleventy templates. With a simple Eleventy shortcode you can opt-in...
Read more >
Eleventy Hub
These collections allow you to sort, filter, and perform other manipulations to customize the display of your template data. Learning all the ways...
Read more >
@11ty/eleventy: Versions | Openbase
Full version history for @11ty/eleventy including change logs.
Read more >
eleventy - githubmemory
Support for global .gitignore · Use frontmatter with the Render plugin · 2.0.0-canary.21 in dev mode: permalinks and collections · Restore extensionless layouts....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found