Skip to content

chore(deps): remove unused dependency declarations#306

Closed
shikokuchuo wants to merge 1 commit into
mainfrom
chore/bd-e3lv7eg3-tree-shake-unused-deps
Closed

chore(deps): remove unused dependency declarations#306
shikokuchuo wants to merge 1 commit into
mainfrom
chore/bd-e3lv7eg3-tree-shake-unused-deps

Conversation

@shikokuchuo

@shikokuchuo shikokuchuo commented Jun 17, 2026

Copy link
Copy Markdown
Member

Removes 59 unused dependency declarations across 27 crates — manifest hygiene, no source changes.

What we used

cargo-machete (--with-metadata) to find unused deps, then Claude verified every hit "by hand" before removing it.

Intentionally risk-averse

We removed only declarations with zero usage and left anything that looks unused but isn't. Kept on purpose:

  • openssl-sys (quarto) — link-only, behind the vendored-openssl feature
  • quarto-error-message-macros (quarto-parse-errors) — proc-macro; derive name ≠ crate name
  • tokio (quarto-lsp-core) — macro-based usage
  • sha2 (quarto-sass) — used in build.rs (machete doesn't scan build scripts)
  • cc + the wasm/fuzz/patch-crate deps — left untouched

Impact

Only pretty_assertions (+ diff) drops from the build graph entirely; the rest were redundant declarations of crates still used elsewhere.

How we tested

Full cargo xtask verify — all 14 steps green, covering cargo build --workspace, cargo nextest run --workspace, the WASM rebuild, and the hub-client build/tests. The all-targets build is itself the proof: any test relying on a removed dev-dep would have failed to compile.

Strand: bd-e3lv7eg3.

@cscheid

cscheid commented Jun 18, 2026

Copy link
Copy Markdown
Member

I think I'm missing something here, because a lot of the lines being removed reference crates we do need (ariadne, for example). Can you clarify what this is trying to do?

@shikokuchuo

Copy link
Copy Markdown
Member Author

I had Claude just double-check on Ariadne as you mentioned it.

  • pampa declared ariadne = "0.6" but has no use for ariadne anywhere in its source. The only real consumer is quarto-error-reporting;
  • pampa gets ariadne formatting transitively through it. So pampa's declaration was redundant — ariadne stays in Cargo.lock and pampa still builds.

I was just trying to see how much we could clean up 'for free' - and it seems not much: the only 2 crates removed are diff and pretty_assertions as nothing used them at all.

Found via cargo-machete, verified by full cargo xtask verify (native +
WASM). 59 redundant declarations removed across 27 crates; pretty_assertions
+ diff drop from Cargo.lock. Kept link/macro/build deps (openssl-sys
vendored, quarto-error-message-macros proc-macro, tokio, sha2 build.rs).
@shikokuchuo shikokuchuo force-pushed the chore/bd-e3lv7eg3-tree-shake-unused-deps branch from 5c0ce89 to 7f36c28 Compare June 18, 2026 15:46
@cscheid

cscheid commented Jun 18, 2026

Copy link
Copy Markdown
Member

Ok, got it. I'm fine with merging this, I just wanted to know the context (we also have a lockfile conflict somehow).

@shikokuchuo

Copy link
Copy Markdown
Member Author

I just wanted to share the result really as I'd attempted it... I've re-based so should be ok to merge.

Also fine not to merge, and leave this all for later...

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.

2 participants