Skip to content

build: Don't re-export foreign crates in utils#4087

Merged
har7an merged 12 commits into
zellij-org:mainfrom
har7an:deps/no-re-exports
Mar 23, 2025
Merged

build: Don't re-export foreign crates in utils#4087
har7an merged 12 commits into
zellij-org:mainfrom
har7an:deps/no-re-exports

Conversation

@har7an
Copy link
Copy Markdown
Contributor

@har7an har7an commented Mar 22, 2025

zellij-utils previously re-exported a bundle of foreign dependencies at the crate root. These were happily used by other zellij components across the codebase in favor of directly depending on these crates.

This raises a few problems:

  1. While coding, it's hard to tell apart which parts of zellij-utils are our own code and which are foreign. This bloats the API surface by an enormous amount.
  2. Dependants of zellij-utils don't enumerate their dependencies correctly: Since zellij-utils re-exports a lot of things, other crates don't define these dependencies themselves. This makes it look like a dependency is used only in zellij utils until the point where you try to remove it and distant parts of the code fall apart

In order to make future work with dependencies easier, this removes the re-exports in zellij-utils and instead makes the respective dependants depend on these packages directly. Where appropriate, dependencies used by multiple components are turned into workspace dependencies to make it clear they're used in multiple places.

har7an added 6 commits March 22, 2025 14:42
for internal code, but use the dependency directly.
but turn `zellij-utils` dependencies into shared workspace dependencies
instead and specify those in `Cargo.toml` explicitly. This gives a much
better overview of what component in zellij uses which crates. The
previous approach hides a lot of this information since it looks like
crates are used in a single place where this isn't actually true.
@har7an har7an merged commit 6be8c49 into zellij-org:main Mar 23, 2025
@har7an har7an deleted the deps/no-re-exports branch March 23, 2025 10:04
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