etagere icon indicating copy to clipboard operation
etagere copied to clipboard

Feature to hide `dump_svg`/`dump_into_svg`?

Open grovesNL opened this issue 2 years ago • 2 comments

A lot of crates depending on this crate probably won't use dump_svg or dump_into_svg, so it would be great if we could remove this dependency by default and still have a way to opt-in (e.g. with a svg feature or similar).

I'd be happy to PR this if that sounds good.

grovesNL avatar Apr 19 '22 11:04 grovesNL

Hi, sorry for the delay I've been away from computers for a couple of weeks.

svg_fmt is a very tiny dependency, it should not affect build times significantly and since there's no polymorphism at play the compiler has a very easy time not inculding the dumping code into the binary if it isn't used.

Unless you have evidence that build times or release binary sizes are noticeably affected I would prefer to keep it without feature gate for simplicity's sake.

nical avatar Apr 29 '22 22:04 nical

No problem!

I'm targeting WebAssembly, so the concern is mostly about binary size and generally avoiding any extra dependencies. I'll check whether it's included into the final binary – maybe it's already being eliminated during build/linking like you mentioned.

grovesNL avatar Apr 29 '22 23:04 grovesNL