-
Notifications
You must be signed in to change notification settings - Fork 222
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
Replace wasm-pack
#1836
Comments
There's now a library that will do build a wasm package as part of the build: Quoting from #2158
So I'll mark this as postponed, but leave it open, and we can implement this when it's available. It'll make the builds faster, much much faster when there are no changes, and reduce our use of unsupported crates. |
This is the beginning of PRQL#1836, replacing `wasm-pack` with https://crates.io/crates/substrate-wasm-builder. `wasm-pack` has been the source of lots of issues, makes builds slower -- in particular small code changes cause a very long iteration cycle in playground builds -- and is no longer maintanied. It's a bit harder than I thought: - We need to create the paths `bundler`, `node`, `web` paths ourselves, replacing [these lines](https://github.com/PRQL/prql/blob/5db61f45ad31ff5673fdfb7890cc3699d47940f9/bindings/prql-js/package.json#L20-L21), by calling `wasm-bindgen debug/wbuild/prql-js/prql_js.wasm --target=...`. - We probably need some way of getting the `.wasm` file location, by reading `include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));` for the `WASM_BINARY` or `WASM_BINARY_BLOATY` constants. Ideally we'd do this at build time, all in the `build.rs` script; I'm not sure whether that's possible though. - Possibly I'm figuring too much of this out on my own and it's done elsewhere? The precedent for this approach seems to be blockchain rather than JS applications...
Update:
So I think for the moment, we can have a build option that runs with Footnotes
|
As discussed in PRQL#1836 (comment)
As discussed in PRQL#1836 (comment)
Not the most urgent item, but would be good to keep our build steps as uncomplicated as possible, and remove dependencies that aren't maintained.
Currently we use
wasm-pack
to bundleprql-js
. IIUC we're using it becausewasm-pack
does wellwasm-bindgen
alone, we keptwasm-pack
and addedpackage.json
scripts to move the files it output (link above)For context,
wasm-pack
is a wrapper ofwasm-bindgen
and isn't really maintained, whereaswasm-bindgen
remains well-supported.As discussed in https://rustwasm.github.io/docs/wasm-bindgen/reference/deployment.html, I think it should be possible to remove this middle layer and use
wasm-bindgen
alone; likely using a similar set of steps to what we do now inpackage.json
scripts.This would be a good contribution for someone who's somewhat familiar with JS, and would like an early PR before diving into the PRQL compiler.
The text was updated successfully, but these errors were encountered: