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

Do not use wildcard pub re-export #430

Closed
haerdib opened this issue Jan 9, 2023 · 3 comments · Fixed by #473
Closed

Do not use wildcard pub re-export #430

haerdib opened this issue Jan 9, 2023 · 3 comments · Fixed by #473
Assignees
Labels
F5-refactor Does not change any functionality of the code Q3-substantial

Comments

@haerdib
Copy link
Contributor

haerdib commented Jan 9, 2023

This can easily lead to exports of the same named struct, such as Error and co (see #424 (comment)).

A cleaner way would be to re-export everything that should be public specifically.

@haerdib haerdib added F5-refactor Does not change any functionality of the code Q0-trivial labels Jan 9, 2023
@clangenb
Copy link
Collaborator

When I tried to integrate the refactored api-client into the worker, I thought that the exports are in general kind of a chaos.

@echevrier echevrier self-assigned this Mar 7, 2023
@echevrier
Copy link
Contributor

echevrier commented Mar 8, 2023

Check wildcard re-export and re-export only "important" items (for example used in the examples) to make them easily searchable/accessible in the public API

  • check that the new path is unique, at every export level (no conflict with another item from other modules)
  • check if the "privacy chain" is short-circuited by re-exproting them
  • check the exported public API

@echevrier
Copy link
Contributor

echevrier commented Mar 8, 2023

Note:
JsonrpseeClient API:

  • substrate_api_client::rpc::JsonrpseeClient
  • substrate_api_client::rpc::SubscriptionWrapper

WsRpcClient API:

  • substrate_api_client::rpc::WsRpcClient
  • substrate_api_client::rpc::subscription::WsSubscriptionWrapper

TungsteniteRpcClient API:

  • substrate_api_client::rpc::TungsteniteRpcClient`
  • substrate_api_client::rpc::TungsteniteSubscriptionWrapper`

@echevrier echevrier linked a pull request Mar 9, 2023 that will close this issue
@echevrier echevrier linked a pull request Mar 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F5-refactor Does not change any functionality of the code Q3-substantial
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants