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

Streamline module structure and imports #367

Closed
PoignardAzur opened this issue Dec 24, 2022 · 1 comment
Closed

Streamline module structure and imports #367

PoignardAzur opened this issue Dec 24, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed masonry Issues relating to the Masonry widget layer

Comments

@PoignardAzur
Copy link
Contributor

PoignardAzur commented Dec 24, 2022

Module structure

Virtually every module should be private. The only public modules should inline modules that gather public-facing re-exports.

Most items should be exported from the root module, with no other public-facing export. This makes documentation more readable; readers don't need to click on multiple modules to find the item they're looking for.

There should be only three public modules:

  • widgets
  • commands
  • test_widgets

Module files should not be foobar/mod.rs. Instead, they should _foobar.rs (thus in the parent folder); the full name is for readability, the leading underscore is so these names appear first in file hierarchies.

Imports

We should avoid use super::xxx imports, except for specific cases like unit tests.

Most imports in the code base should use the canonical top-level import.

Prelude

Masonry should have no prelude. Examples and documentation should deliberately have a list of imports that cover everything users will need, so users can copy-paste these lists.

@PoignardAzur PoignardAzur added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Dec 24, 2022
@DJMcNab DJMcNab added the masonry Issues relating to the Masonry widget layer label Apr 19, 2024
@DJMcNab DJMcNab transferred this issue from linebender/masonry Jun 5, 2024
@PoignardAzur
Copy link
Contributor Author

Addressed by #848 and #843.

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 help wanted Extra attention is needed masonry Issues relating to the Masonry widget layer
Projects
None yet
Development

No branches or pull requests

2 participants