vtracer icon indicating copy to clipboard operation
vtracer copied to clipboard

Standalone Javascript module?

Open mootari opened this issue 3 years ago • 5 comments

Are you planning to bundle or release a standalone Javascript module that can be included directly in the browser?

mootari avatar May 27 '21 15:05 mootari

Well I could not figure out how to actually ship a wasm module in npm, I'd do so if there is a standardized method. Otherwise, for now, you can simply use the binary in docs.

tyt2y3 avatar May 27 '21 15:05 tyt2y3

Sorry for the late response, I had to put my experiments with vtracer on hold.

I was able to create a build using wasm-pack build --target web which is currently hosted in a gist. I'm also in the process of porting the demo to Observable and plan to document any perceived shortcomings in the API (e.g. reliance on IDs instead of passing in Element objects, errors due to parallel lines etc). Will keep you posted once I get a chance to continue work.

mootari avatar Jul 20 '21 13:07 mootari

Nice! Yes it is actually quite easy if you install the Rust toolchain

tyt2y3 avatar Jul 20 '21 13:07 tyt2y3

https://github.com/ssssota/svg2png-wasm is also using wasm-pack to publish rust module as npm package. Check it out if you are intending to do so.

OpenGG avatar Nov 23 '21 09:11 OpenGG

Thanks for the suggestion. The project looks interesting indeed.

tyt2y3 avatar Nov 24 '21 16:11 tyt2y3