render.rs icon indicating copy to clipboard operation
render.rs copied to clipboard

Privacy & Visibility

Open theashguy opened this issue 5 years ago • 1 comments

Hey there @Schniz -- first up, awesome stuff. I've been dreaming of a few hours to do something like this for the last 12 months. Ergonomics matter.

I went down a rabbit hole yesterday and converted a non-trivial part of my app that was using tera templates into render, following patterns I'd use in JSX land. Found the debugging process was reasonably straight forward, but I've hit a seemingly critical snag-- I'm unable to share the components created in one module (say my component library module) into another one that isn't a direct descendant due to Rusts Privacy semantics. It doesn't seem like the #[component] macro respects pub against the function as something that should flow to its params (resulting in a lot of field 'stack' of struct 'components::layout::nav::Top' is private and similar).

My question:

Is this an oversight due to the newness of the library, or is there actually a mechanism around for solving it? If its a missing feature, how do you imagine it working (I might poke around and see if I can raise a PR if there is time in the day).

Thanks for the great work.

Cheers. Ash.

theashguy avatar May 23 '20 23:05 theashguy

I didn't want to abandon my branch so I've raised a PR to fix this one :D

https://github.com/Schniz/render.rs/pull/15

theashguy avatar May 24 '20 01:05 theashguy