rust-playground icon indicating copy to clipboard operation
rust-playground copied to clipboard

Support wasm-pack backend

Open titaneric opened this issue 3 years ago • 7 comments

This PR aims to solve #374 , which is the backend service for it.

Change of code

  • Add new wasm-pack POST method which request Rust code and response with wasm_js, wasm_bg etc.
  • New directory specific to wasm-pack
  • Add cargo-pack which leverage wasm-pack to build the wasm code
  • Add new Dockerfile for new channel rust-wasm-pack
  • Add new Cargo.toml and dummy src/lib.rs for environment setting

Note

  • Present supporting wasm library include the following
wasm-bindgen
web-sys
js-sys
wasm-bindgen-futures
yew
seed
  • The above dependencies is defined in compiler/wasm-pack/Cargo.toml not top-crates/crate-modifications.toml, I am not sure which way is better.
  • I have to cite seed-playground here who greatly influence me.

Demo

rust-playground

https://user-images.githubusercontent.com/12388235/114809686-39eb7e80-9ddd-11eb-96fd-a8b9e221e147.mp4

mdBook

https://user-images.githubusercontent.com/12388235/114810242-3b697680-9dde-11eb-85f3-a6e746aaa0c1.mp4

titaneric avatar Apr 15 '21 03:04 titaneric

Any news about this PR?

titaneric avatar Aug 08 '21 15:08 titaneric

@shepmaster sorry for the ping but any chance this could be merged?

lukechu10 avatar Aug 27 '21 17:08 lukechu10

@lukechu10 and anyone interested in this feature could try my own hosting rust-playground, and the repository is here.

Note that due to the limited budgets, I host it with the minimal resource (1 CPU and 1 G RAM). Hope that someone could try it and give me some feedback.

I will contine try to merge to original one.

titaneric avatar Sep 20 '21 10:09 titaneric

Hey, are there any updates on this from this repo owners? Is there any help needed for getting this forward, or this is supposed to be will-not-merge kind of thing?

YJDoc2 avatar Nov 21 '22 09:11 YJDoc2

@YJDoc2, thank you for your interest. Obviously, the upstream is highly refactored after I submitted this PR. I will take care of the refactoring if exists any chance that could be merged into upsteam

titaneric avatar Nov 21 '22 12:11 titaneric

@shepmaster sorry for pinging, but would this project be interested in merging this/equivalent PR? This would be a pretty interesting feature to have in the playground.

YJDoc2 avatar Nov 21 '22 15:11 YJDoc2

Hey @dtolnay @RalfJung sorry for the ping, but pinging you as you seem to also be one of the recent active contributors. It seems that @shepmaster might have missed the ping, or they might be busy with something else. Is there any chance of this getting merged after appropriate changes? Thank you!

YJDoc2 avatar Nov 28 '22 15:11 YJDoc2