Skip to content
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

Consider support for a /wasm folder at the root that can ship .wasm to the browser #354

Open
rglover opened this issue Oct 12, 2023 · 0 comments
Assignees
Labels
feature Something new to add @joystick.js/node Related to the @joystick.js/node package. @joystick.js/ui Related to the @joystick.js/ui package.
Projects

Comments

@rglover
Copy link
Contributor

rglover commented Oct 12, 2023

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.

@rglover rglover added feature Something new to add @joystick.js/ui Related to the @joystick.js/ui package. @joystick.js/node Related to the @joystick.js/node package. labels Oct 12, 2023
@rglover rglover self-assigned this Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Something new to add @joystick.js/node Related to the @joystick.js/node package. @joystick.js/ui Related to the @joystick.js/ui package.
Projects
1.x.x
Awaiting triage
Development

No branches or pull requests

1 participant