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

Hide sov-modules-macros for all public APIs; re-export from sov-modules-api #542

Merged
merged 9 commits into from
Jul 24, 2023

Conversation

neysofu
Copy link
Member

@neysofu neysofu commented Jul 21, 2023

Description

My goal with this PR is to collect feedback –and not necessarily merge right away, unless feedback is positive– about a total removal of the sov_modules_macros from all public APIs. The less crates the user has to interact with, the better, from my POV; this pattern is also popular in well-regarded crates like serde.

The current contents of the sov-modules-macros crates will get re-exported by sov-modules-api as following:

  • Trait derives will be available at the root module sov_modules_api, which allows for importing the derive macro together with the trait.
  • rpc_gen, cli_parser, DefaultRuntime and all other proc macros (for which there's no homonymous trait) will be available under sov_modules_api::macros.

All of these will be gated by the macros feature flag.

Screenshot 2023-07-21 at 13-10-42 sov_modules_api - Rust

Testing

Relying on current tests. Doctests have been updated as necessary.

Docs

Examples and READMEs have been updated.

@neysofu neysofu added documentation Improvements or additions to documentation usability Something that makes it easier to use or operate Sovereign SDK labels Jul 21, 2023
@neysofu neysofu marked this pull request as draft July 21, 2023 11:35
@neysofu neysofu force-pushed the filippo/reexport-macros branch 2 times, most recently from 94be4c4 to 017f669 Compare July 21, 2023 12:38
@neysofu neysofu marked this pull request as ready for review July 24, 2023 11:50
@neysofu neysofu merged commit 787c63c into nightly Jul 24, 2023
11 checks passed
@neysofu neysofu deleted the filippo/reexport-macros branch July 24, 2023 15:32
preston-evans98 pushed a commit that referenced this pull request Sep 14, 2023
…dules-api` (#542)

* Re-export macros for `sov-modules-api`

* Remove direct use of `sov-modules-macros`

* Update all docs

* Fix intradoc links

* Fix macros module doc comment & import

* Fix all tests

* Fix default features

* Fix README code example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation usability Something that makes it easier to use or operate Sovereign SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants