wasm-pack-plugin icon indicating copy to clipboard operation
wasm-pack-plugin copied to clipboard

Rename project to @wasm-tool/rust-webpack-plugin

Open xtuc opened this issue 5 years ago • 6 comments

We should rename this project to @wasm-tool/rust-webpack-plugin, to be consistent with the Rollup plugin @wasm-tool/rollup-plugin-rust (https://github.com/wasm-tool/rollup-plugin-rust).

To help the migration we should add a deprecation message to wasm-pack-plugin and indicate the path to migrate.

xtuc avatar Feb 11 '20 21:02 xtuc

but this expects wasm pack right?

sendilkumarn avatar Feb 12 '20 08:02 sendilkumarn

Yes, the plugin will still continue to use wasm-pack.

@Pauan would like to move their rust plugin for rollup in the wasm-tool org and to have consistent naming across both loaders/plugins

Wasm-pack is just an implementation detail at this point. What it really does is compile rust

xtuc avatar Feb 12 '20 17:02 xtuc

I mean we can genuinely have a pure rust based plugin and compile Rust to WebAssembly right? My only (tiny) concern is that. 🙂

sendilkumarn avatar Feb 22 '20 14:02 sendilkumarn

@sendilkumarn A plugin like that won't be very useful though, because it would only be able to send primitive types like integers and floats to/from JS.

It wouldn't be able to use JS objects, and it wouldn't be able to use any complex Rust types (such as Vec, String, &[u8], etc).

So it would be great for implementing pub extern "C" fn add(x: i32, y: i32) -> i32 { x + y } and not much else.

Pauan avatar Feb 22 '20 14:02 Pauan

@Pauan Yeah definitely, my previous comment (implicitly) includes wasm-bindgen by default. Again it is only a small concern, but we have to explicitly mention that it uses wasm-pack.

sendilkumarn avatar Feb 22 '20 14:02 sendilkumarn

@sendilkumarn As far as I can see, the only thing intrinsically tying this plugin to wasm-pack is the extraArgs option. Everything else can be abstracted away so that there's no difference between running wasm-pack and running wasm-bindgen directly.

That's what rollup-plugin-rust does: it doesn't have anything tying it to wasm-pack, so the implementation can be easily changed.

I think it's reasonable to mention wasm-pack in the README and documentation, but I don't think it's as important for it to be a part of the name, especially because wasm-pack is the official blessed way to build Rust + Wasm projects.

Pauan avatar Feb 22 '20 17:02 Pauan