You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A reused TypstCompiler never picks up changes to files on disk #28
SlotCell::accessed (world.rs:225) is set to true on first access and is never reset. There is no per-compile file-slot reset anywhere in the crate, only reset_time() for the clock.
So a compiler created with FromFile caches the source and every import from its first compile and keeps serving them for the lifetime of the object. Rewriting the .typ on disk and compiling again returns the old output, with no error.
That matters because reusing one compiler across renders is the recommended pattern - the README suggests caching it to get a compile from 40ms down to around 3ms. Anyone who does that and also reloads templates gets silently stale output.
Two ways out: reset the file slots at the start of each compile, which is what typst-cli does between watch runs, or document that a compiler pins its inputs at first compile and has to be recreated when a template changes.
Fair point - up until now the "deployment model" used was a full restart.
I think following the typst-cli is ok and resetting the file slots is the most expected behaviour.
Opened #39, which resets the file slots at the start of each compilation, as typst-cli does between watch runs. In-memory documents from FromSource are left alone, since there is no file behind them.
Activity
evolvedlight commentedon Sep 6, 2026
Fair point - up until now the "deployment model" used was a full restart.
I think following the typst-cli is ok and resetting the file slots is the most expected behaviour.
Happy to accept a PR for this.
msallin commentedon Sep 6, 2026
Opened #39, which resets the file slots at the start of each compilation, as typst-cli does between watch runs. In-memory documents from
FromSourceare left alone, since there is no file behind them.