dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Make proc-macro generated types/traits respect visibility

Open rickvanprim opened this issue 6 months ago • 0 comments

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

rickvanprim avatar Jun 15 '25 05:06 rickvanprim