maciejhirsz / kobold

Easy declarative web interfaces.
https://docs.rs/kobold/
Mozilla Public License 2.0
385 stars 7 forks source link

Suggest explicit import in the hello_world example #22

Closed ltfschoen closed 1 year ago

ltfschoen commented 1 year ago

In the beginner hello_world example, instead of importing everything with use kobold::prelude::*; perhaps change to just use kobold::prelude::{component, html, Html};

maciejhirsz commented 1 year ago

That would have to be use kobold::{component, html, Html}; if anything, but I don't think that's necessary. The whole point of having a prelude is to do a blanket import of everything in it, it is a common pattern.

Not all crates should have a prelude, people have strong opinions about it. Personally I think the border here is kind of fuzzy, something like arrayvec doesn't need one and shouldn't have one, but things like game engines or web frameworks (if you can call Kobold that) should.

With that in mind I'd rather keep the hello world as is, since using kobold::prelude::* is a good pattern here.