Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

JohnTheCoolingFan
Copy link
Contributor

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
Copy link
Owner

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

@erwanvivien
Copy link
Owner

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
Copy link
Contributor Author

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
Copy link
Owner

So you're using the same command?

@JohnTheCoolingFan
Copy link
Contributor Author

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
Copy link
Owner

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

@JohnTheCoolingFan
Copy link
Contributor Author

No, I'm using image as well

@erwanvivien
Copy link
Owner

👌

@JohnTheCoolingFan
Copy link
Contributor Author

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

@JohnTheCoolingFan
Copy link
Contributor Author

JohnTheCoolingFan commented Oct 9, 2023

Ah, yes: rustwasm/wasm-bindgen#3297
I'm reverting to 2 definitions then

@JohnTheCoolingFan
Copy link
Contributor Author

Alright, no more conflicting stuff

…arch

Only when doing JS stuff using wasm-bindgen we need to remove the
custom function implementation
@erwanvivien
Copy link
Owner

Thanks a lot @JohnTheCoolingFan

@erwanvivien
Copy link
Owner

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

@JohnTheCoolingFan
Copy link
Contributor Author

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

@erwanvivien erwanvivien merged commit 4bdc3d3 into erwanvivien:master Oct 9, 2023
4 checks passed
@erwanvivien
Copy link
Owner

Will do soon :)

@erwanvivien
Copy link
Owner

erwanvivien commented Oct 9, 2023

Hey @JohnTheCoolingFan, 0.10.3 is up now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why is Shape::Command disabled on wasm?
2 participants