Skip to content

Review foreign types in public APIs #3177

@Frando

Description

@Frando

Tracking issue to check / remove / review which items from foreign crates we expose in the public APIs of the iroh crates.

Each foreign item in the public API means that we cannot do a semver-breaking update of that crate during 1.0, so we should keep this list as small as possible.

There's a tool called cargo-check-external-types which produces a list of foreign types that are used in public APIs.

List of PRs to reduce surface

Remaining items

With all the above PRs merged and the external_types.toml config below, only these items remain that we should discuss:

iroh-base

empty 🥇

iroh-dns

empty 🥇

iroh-dns-server

empty 🥇

iroh

empty 🥇

iroh-relay

empty 🥇

External types

Here's the external-types.toml config that I'm using to produce the above list.

allowed_external_types = [
    # workspace crates
    "iroh_base::*",
    "iroh_dns::*",
    "iroh_relay::*",

    # 1.0 crates that we deem fine to be part of the public API
    "bytes::*",
    "http::*",
    "http_body::*",
    "hyper::*",
    "rustls_pki_types::*",
    "serde::*",
    "serde_core::*",
    "tokio::*",
    "url::*",

    # crates owned by us that will move to 1.0 as well
    "iroh_metrics::*",
    "n0_error::*",
    "n0_watcher::*",
    "noq::*",
    "noq_proto::*",
    "noq_udp::*",
    "portmapper::metrics::Metrics",

    # non-1.0 crates that we decided to accept in the public API
    "rustls::*",
    "tokio_rustls::*",
    "futures_core::stream::Stream",
    "futures_sink::Sink",
    # these are only type aliases
    "futures_lite::future::Boxed",
    "futures_lite::stream::Boxed",
]

Metadata

Metadata

Assignees

Labels

APItrackingan overview issue that tracks completion of a project

Type

No fields configured for Task.

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions