DioxusLabs / DioxusLabs/dioxus

Make proc-macro generated types/traits respect visibility

Open
#4,279 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

Would it be possible to match the component's visibility for the generated helper types/traits?

For example, both `{builder_name}_Optional` and `{}_Error_Repeated_field_{}` are both unconditionally `pub` which is producing the following warning in my repo (as I'm using glob exports):
```
pub use self::editor_layout::*;
| ^^^^^^^^^^^^^^^^^^^^^^ the name `MenuContentPropsBuilder_Optional` in the type namespace is first re-exported here
...
pub use self::ui_editor::*;
| ------------------ but the name `MenuContentPropsBuilder_Optional` in the type namespace is also re-exported here
```

In both files, I have a private helper component `MenuContent` which leads to types/traits with the same set of names generated, which then get caught up in the glob export, even though the `MenuContent` components themselves are private to the module.

https://github.com/DioxusLabs/dioxus/tree/main/packages/core-macro/src/props/mod.rs#L908
https://github.com/DioxusLabs/dioxus/tree/main/packages/core-macro/src/props/mod.rs#L1211

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.