Consider support for a /wasm folder at the root that can ship .wasm to the browser
Wrote down a note in my sketchbook about this and I think it would work quite well. The real advantage with WASM is in the browser, not on a third-party platform.
Why: I can write resource-intensive code that needs to run on a per-user basis (e.g., calculating some statistics) and run it on a user's hardware. The advantage is that I'm not resource-capped by a remote instance or any convoluted deployment system.
In Joystick, I think we could set up a way to make it so you could load WASM modules at the component level (e.g., add an option called wasm to the component options):
import calca
const MyComponent = joystick.component({
wasm: [
'calculate_monthly_report',
],
events: {
'click .generate-report': async (event, instance) => {
const report = await instance.wasm.calculate_monthly_report();
console.log(report);
},
},
});
The whole idea here being that I can call WASM code via my UI and Joystick automatically ships the specified wasm modules down to the client.
In theory, this could help with a lot of performance stuff, but, you'd need to be mindful about security. It seems like the sandboxed nature of WASM modules would help with most of this.
See implementation notes: https://claude.ai/chat/f8048055-0675-4369-8cd9-23e73d426deb