junkdog / tachyonfx

shader-like effects library for ratatui applications
MIT License
662 stars 8 forks source link

Update to bon 2.0 #6

Closed Veetaha closed 2 months ago

Veetaha commented 2 months ago

Hi! I'm the maintainer of the bon crate. I've created a 2.0 release with some breaking changes. While there aren't too many repos using bon, I'm assisting with the upgrade myself.

There is the link to the Reddit post and the blog post itself.

The main breaking change that requires a migration is that there will no longer be automatic Into conversions (https://github.com/elastio/bon/issues/15#issuecomment-2297202745). It means there won't be automatic impl Into<String> in setters. If you want to enable impl Into for all String types, you need to use #[builder(on(String, into))] at the top level or add #[builder(into)] at the member level.

Also, any feedback on this change would be appreciated!


I see there are a lot of usages of #[builder] in pub items. It means a lot of setters now accept impl Into<_>. Do you think it makes sense to review all the setters and remove impl Into<_> from them (which would be a breaking change for the crate), or should we just enable impl Into everywhere where bon v1 enabled it automatically?

junkdog commented 2 months ago

Hi,

Nice, looking good. I'm also into the camp preferring opt in for into conversions.

I'm not too worried about breaking the builders by removing automatic into conversions. I think it makes sense to keep Into for EffectTimer, but the rest are probably better served without.

junkdog commented 2 months ago

i've updated to 2.0.1, put #builder(into) on all EffectTimers - and merged this pull request, but github fails to pick it up due to the rebase (i think) so closing it now instead.