elldritch / elldritch/broccoli-pug

Cache invalidation bug

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
CoffeeScript
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Heya, I've been using your plugin and came across the following bug: The `getReferences` function doesn't recurse into included files, so if `a.pug` includes `b.pug`, which includes `c.pug`, `a.html` will only be rebuilt if `b.pug` changes, but not if `c.pug` changes.

Rather than fixing this particular issue, I'd prefer redoing the caching logic: Instead of having broccoli-pug try to figure out the dependencies, it might make sense to add some hooks to Pug so that instead of always compiling files, it gives broccoli-pug a chance to return an AST from cache. (I'm a bit short on time, but happy to elaborate more on this later, if you like.) I've gone ahead and opened an issue on the pug repo: https://github.com/pugjs/pug/issues/2668 Hopefully they'll have some thoughts on where to best add hooks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the getReferences function and reproducing the a.pug → b.pug → c.pug invalidation case described in the issue. Then review the linked Pug issue about cache hooks; done means agreeing on and implementing a viable caching or dependency approach that rebuilds a.html when c.pug changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript, pug
Domain
build-system, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.