Skip to content

Make proc-macro generated types/traits respect visibility #4279

Open
@rickvanprim

Description

@rickvanprim

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions