erwanvivien / fast_qr

Ultra fast QRCode generation
https://fast-qr.com/
MIT License
197 stars 29 forks source link

Disable `Shape::Command` only when `wasm-bindgen` feature is used #41

Closed JohnTheCoolingFan closed 11 months ago

JohnTheCoolingFan commented 11 months ago

Fixes #40

Changed cfg and cfg_attr attributes to do changes that conflict with exposing the api to wasm only when wasm-bindgen is enabled so that teh library can be used in projects compiled for wasm which do not need wasm-bindgen for this crate.

erwanvivien commented 11 months ago

Hey, I'll look into this today, same for your other PR! Thanks :)

erwanvivien commented 11 months ago

I'm curious, how do you build your Wasm file? I'd like to try the PR I ran cargo r --target wasm32-unknown-unknown -Fimage --example image that did not work

JohnTheCoolingFan commented 11 months ago

Try reading the error. On my end thsi command gives an error in criterion because it's one of the dev dependencies. I'll see if rayon feature can be turned off for wasm target.

erwanvivien commented 11 months ago

So you're using the same command?

JohnTheCoolingFan commented 11 months ago

I tested the PR by building a project that depends on the lib. I now see that I overlooked that exampels also need to run and this was not an obvious issue

erwanvivien commented 11 months ago

You're only using the svg feature in your project, right?

JohnTheCoolingFan commented 11 months ago

No, I'm using image as well

erwanvivien commented 11 months ago

👌

JohnTheCoolingFan commented 11 months ago

Hmm, that buidl error is weird. I thought cfg attrs worked on enum variants, looks like they don't

JohnTheCoolingFan commented 11 months ago

Ah, yes: https://github.com/rustwasm/wasm-bindgen/issues/3297 I'm reverting to 2 definitions then

JohnTheCoolingFan commented 11 months ago

Alright, no more conflicting stuff

erwanvivien commented 11 months ago

Thanks a lot @JohnTheCoolingFan

erwanvivien commented 11 months ago

Do you need me to release a minor version on crates.io ?

JohnTheCoolingFan commented 11 months ago

Yes, an update on crates.io would be very welcome

erwanvivien commented 11 months ago

Will do soon :)

erwanvivien commented 11 months ago

Hey @JohnTheCoolingFan, 0.10.3 is up now :)