Denperidge / eleventy-auto-cache-buster

An Eleventy content-hash based cache buster, not requiring any filters or code changes aside from enabling the plugin!
https://www.npmjs.com/package/eleventy-auto-cache-buster
MIT License
9 stars 0 forks source link

Option for synchronous operation? #8

Closed sjml closed 1 month ago

sjml commented 1 month ago

I'm trying to integrate this plugin to a workflow that runs some additional bundling after the cache-busting has been applied, but since it runs with async it just returns immediately and I don't know when it's safe to run the next step.

I started to put together a PR to accept a flag to run synchronously, but wanted to check and see if that was something you'd be open to.

If I'm mistaken and there's some built-in way in Eleventy to await results of an event handler, please let me know.

Denperidge commented 1 month ago

Absolutely, go for it! As long as its a flag/optional, it’s all good 😌 On 10 Aug 2024 at 05:24 +0200, Shane Liesegang @.***>, wrote:

I'm trying to integrate this plugin to a workflow that runs some additional bundling after the cache-busting has been applied, but since it runs with async it just returns immediately and I don't know when it's safe to run the next step. I started to put together a PR to accept a flag to run synchronously, but wanted to check and see if that was something you'd be open to. If I'm mistaken and there's some built-in way in Eleventy to await results of an event handler, please let me know. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Denperidge commented 1 month ago

Hi! Released 0.6.0 on 02de6e490c59a2ea5241134577a32fb35059d3b5, let me know if it works! (I added the co-author but GitHub isn't showing you as contributor though, for which my apologies! I assumed it would count the co-author and tag)

sjml commented 1 month ago

Looks great! Thanks so much for the work. Absolutely no worries about the contributor count; I'm in it for the functionality, not the glory. :)

sjml commented 1 month ago

Just FYI -- I brought up the overarching issue (that event handlers potentially run in parallel, making combining plugins difficult-to-impossible) on the Eleventy Discord, and they quickly agreed that it's something that should be addressed. So now it's on their radar! https://github.com/11ty/eleventy/issues/3415