brycx / pasetors

PASETOrs: PASETO tokens in pure Rust
MIT License
87 stars 9 forks source link

Enable `getrandom/js` feature and test `wasm32-unknown-unknown` in CI #37

Closed brycx closed 2 years ago

brycx commented 2 years ago

fixes #36

brycx commented 2 years ago

@achmadk You can try out this branch to see if it covers your use-case.

[dependencies.pasetors]
git = "https://github.com/brycx/pasetors"
branch = "wasm"
achmadk commented 2 years ago

Maybe you can implement those additional steps from this article

Maybe you can also publish generated files of wasm-pack build into npm registry. You can read article here.

brycx commented 2 years ago

Maybe you can implement those additional steps from this article

All the steps of that article are covered, except for adding wasm-bindgen "and js-sys and web-sys if you need them". I don't know if the last two are needed in addition to wasm-bindgen, but is this the step you are referring to?

Maybe you can also publish generated files of wasm-pack build into npm registry. You can read article here.

This I won't do. I have never really worked with JS, nor used npm and I have no intentions of starting right now. I'll give it some more thought, perhaps I change my mind in the future. But for now, I don't want to maintain and update two different registries for this crate.

In extension to my lack of experience with JS, if you meant for me to use wasm-bindgen then I'd probably need some help with this due to my lack of knowledge there.

achmadk commented 2 years ago

All the steps of that article are covered, except for adding wasm-bindgen "and js-sys and web-sys if you need them". I don't know if the last two are needed in addition to wasm-bindgen, but is this the step you are referring to?

I think js-sys and web-sys not need to be added into Cargo.toml file.

In extension to my lack of experience with JS, if you meant for me to use wasm-bindgen then I'd probably need some help with this due to my lack of knowledge there.

Maybe I can help you although I still learning rust programming language for WASM.

brycx commented 2 years ago

Thanks! If you end up working on it, feel free to ping me here or on email if you have any questions that I might be able to answer.

I'll merge this pull-request but keep the issue open.