Skip to content

feat(html): translate without a cache path - #663

Merged
andiwand merged 1 commit into
mainfrom
feat/html-no-cache-path
Aug 8, 2026
Merged

feat(html): translate without a cache path#663
andiwand merged 1 commit into
mainfrom
feat/html-no-cache-path

Conversation

@andiwand

@andiwand andiwand commented Aug 8, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Split out of #661 — no wasm in here. Stacked on #662.

html::translate has taken a cache_path on every overload, documented as "the
directory temporary output goes into". Nothing goes into it. All seven
create_*_service factories had already marked the parameter unused — media
included, which was the last plausible candidate — so the only thing the public
wrapper did with it was create_directories on a directory nobody subsequently
wrote into.

This adds an overload per translate without it, and drops the parameter from
the internal factories rather than only from the public surface. That is the
point: with it gone from the factories, "no renderer writes to disk" stops being
a coincidence and becomes structural. The only std::filesystem left in
html.cpp is inside bring_offline, which writes to disk by definition.

The cache_path overloads stay, as forwards, and are deliberately not
[[deprecated]]: CI builds with -Werror and cli/, python/, jni/ and
apple/ all still pass one.

Behaviour change: translate no longer creates the directory it was handed.
Nothing reads or writes there, and cli/src/server.cpp — the only caller that
cares where its cache lives — already creates its own.

Reference output unchanged; full suite green.

`html::translate` has taken a `cache_path` on every overload, documented as
"the directory temporary output goes into". Nothing goes into it. All seven
`create_*_service` factories had already marked the parameter unused — media
included, which was the last plausible candidate — so the only thing the
public wrapper did with it was `create_directories` on a directory nobody
subsequently wrote into.

Add an overload per `translate` without it, and drop the parameter from the
internal factories rather than only from the public surface. That is the
point: with it gone from the factories, "no renderer writes to disk" stops
being a coincidence and becomes structural. The only `std::filesystem` left in
`html.cpp` is inside `bring_offline`, which writes to disk by definition.

The `cache_path` overloads stay, as forwards, and are deliberately not marked
`[[deprecated]]`: CI builds with `-Werror` and `cli/`, `python/`, `jni/` and
`apple/` all still pass one. Deprecation follows once they are migrated.

Behaviour change: `translate` no longer creates the directory it was handed.
Nothing reads or writes there, and `cli/src/server.cpp` — the only caller that
cares where its cache lives — already creates its own.

If rendering ever does want a cache — PDF page backgrounds being the obvious
candidate, expensive and re-rendered per view — the injection point is an
`abstract::Filesystem`, not a path: `VirtualFilesystem` keeps it off the disk
and out of `std::filesystem` entirely. Not a `cache_path` string again.

Reference output is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BjFJ66sma1ye9ZnhM3tNeH
@andiwand
andiwand force-pushed the feat/html-no-cache-path branch from c485e8f to f0edaed Compare August 8, 2026 18:26
@andiwand
andiwand enabled auto-merge (squash) August 8, 2026 18:30
@andiwand
andiwand merged commit feec0cd into main Aug 8, 2026
34 checks passed
@andiwand
andiwand deleted the feat/html-no-cache-path branch August 8, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant