grafana / plugin-tools

Create Grafana plugins with ease.
https://grafana.com/developers/plugin-tools/
Apache License 2.0
55 stars 27 forks source link

Feat: Support wasm files when bundling plugins #933

Closed jackw closed 3 weeks ago

jackw commented 1 month ago

Which areas does this feature request relate to

Problem

Machine learning related projects/libraries can contain wasm files that the current webpack config doesn't know how to handle. Rather than expect plugin developers to customise their configs for these libraries it's probably better that we support it out the box.

Solution

Update the config to support wasm. Webpack has multiple options here:

  1. Use experiments.asyncWebAssembly.
  2. Use asset/resource.

Alternatives

No response

Additional context

No response

Are you interested in contributing the solution?

sd2k commented 4 weeks ago

Interestingly I see zero difference in the generated module.js when using experiments.asyncWebAssembly vs asset/resource :shrug:

Given that the asyncWebAssembly flag will default to true in the next version of Webpack it feels like it might be the better call, as there may be future WASM-based optimizations built in to Webpack.

grafana-plugins-platform-bot[bot] commented 3 weeks ago

:rocket: Issue was released in @grafana/create-plugin@4.12.0 :rocket: