Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All crates should have a consistent API & naming #2217

Open
14 of 19 tasks
thomaseizinger opened this issue Sep 7, 2021 Discussed in #2174 · 1 comment
Open
14 of 19 tasks

All crates should have a consistent API & naming #2217

thomaseizinger opened this issue Sep 7, 2021 Discussed in #2174 · 1 comment
Labels
tracking-issue Issues which are the entry point to bigger projects.

Comments

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Sep 7, 2021

Discussed in #2174.

Summary:

Rename symbols within libp2p- sub crates such that they can best be references via the module that is re-exported from the libp2p meta-crate. For example:

use libp2p::ping;

let behaviour = ping::Behaviour::new(ping::Config::default());

Crates

@thomaseizinger
Copy link
Contributor Author

I followed the same approach outlined here in #2859 and introduced top-level dummy and keep_alive modules in libp2p-swarm. I think eventually, it would be great if we can also introduce these top-level modules in libp2p and re-export these kind of modules there. That would allow us to group things like dummy::Behaviour and dummy::ConnectionHandler together under libp2p::dummy which would be consistent with the re-export of sub-crates like libp2p::ping or libp2p::kad.

thomaseizinger added a commit that referenced this issue Sep 30, 2022
elenaf9 added a commit to kpp/rust-libp2p that referenced this issue Oct 4, 2022
mxinden pushed a commit that referenced this issue Oct 5, 2022
…ler` (#2859)

Previously, the `DummyConnectionHandler` offered a "keep alive" functionality,
i.e. it allowed users to set the value of what is returned from
`ConnectionHandler::keep_alive`. This handler is primarily used in tests or
`NetworkBehaviour`s that don't open any connections (like mDNS). In all of these
cases, it is statically known whether we want to keep connections alive. As
such, this functionality is better represented by a static
`KeepAliveConnectionHandler` that always returns `KeepAlive::Yes` and a
`DummyConnectionHandler` that always returns `KeepAlive::No`.

To follow the naming conventions described in
#2217, we introduce a top-level
`keep_alive` and `dummy` behaviour in `libp2p-swarm` that contains both the
`NetworkBehaviour` and `ConnectionHandler` implementation for either case.
thomaseizinger added a commit that referenced this issue Dec 8, 2022
This follows the guidelines discussed in #2217.
thomaseizinger added a commit that referenced this issue Dec 8, 2022
This follows the guidelines discussed in #2217.
mergify bot pushed a commit that referenced this issue Dec 13, 2022
…#3213)

`cargo semver-checks` is still missing features in regards to properly detecting renamed exports. To make our CI pass again, we remove the renamed export, replace it with type-aliases and deprecate them to point users types exported under a module which now follows the conventions set in #2217.
mergify bot pushed a commit that referenced this issue Dec 20, 2022
With this patch, the naming of types follows the guidelines discussed in #2217.
mergify bot pushed a commit that referenced this issue Jan 2, 2023
mergify bot pushed a commit that referenced this issue Jan 27, 2023
mergify bot pushed a commit that referenced this issue Apr 28, 2023
In the libp2p specs, the only handshake pattern that is specified is the XX handshake. Support for other handshake patterns can be added through external modules. While we are at it, we rename the remaining types to following the laid out naming convention.

The tests for handshakes other than XX are removed. The handshakes still work as we don't touch them in this patch.

Related #2217.

Pull-Request: #3768.
mriise added a commit to mriise/rust-libp2p that referenced this issue Apr 29, 2023
mergify bot pushed a commit that referenced this issue May 1, 2023
Implements our naming convention for the `libp2p-yamux` crate.

Related: #2217.

Pull-Request: #3852.
@thomaseizinger thomaseizinger removed help wanted difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well labels Sep 12, 2023
@thomaseizinger thomaseizinger changed the title Tracking issue for renaming symbols across the repository Renaming symbols across the repository Sep 19, 2023
@thomaseizinger thomaseizinger changed the title Renaming symbols across the repository All crates should have a consistent API & naming Sep 19, 2023
@thomaseizinger thomaseizinger added the tracking-issue Issues which are the entry point to bigger projects. label Sep 19, 2023
mergify bot pushed a commit that referenced this issue Sep 24, 2023
Renamed the following
- `dns::GenDnsConfig`  ->  `dns::Config`
- `dns::DnsConfig` -> `dns::async_std::Config`
- `dns::TokioDnsConfig` -> `dns::tokio::Config`

If async-std feature is enable, use `dns::async_std::Config`. When using tokio, import `dns::tokio::Config` . There is no need to use `dns::Config` directly.

Resolves #4486.
Related: #2217.

Pull-Request: #4505.
mergify bot pushed a commit that referenced this issue Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracking-issue Issues which are the entry point to bigger projects.
Projects
None yet
Development

No branches or pull requests

1 participant