Page MenuHomePhabricator

[web] Scaffolding for opaque-ke-wasm project
ClosedPublic

Authored by ashoat on Mar 22 2023, 4:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 8, 1:37 AM
Unknown Object (File)
Fri, Mar 8, 1:37 AM
Unknown Object (File)
Thu, Mar 7, 9:01 PM
Unknown Object (File)
Thu, Mar 7, 9:01 PM
Unknown Object (File)
Feb 23 2024, 11:58 AM
Unknown Object (File)
Feb 23 2024, 11:56 AM
Unknown Object (File)
Feb 23 2024, 9:33 AM
Unknown Object (File)
Feb 23 2024, 6:41 AM
Subscribers

Details

Summary

We want to publish WASM sources for comm-opaque2 in an NPM package to avoid harming the developer experience of working on web by adding a WASM compilation step.

Instead, we'll compile the WASM into a discrete NPM package that we'll consume from web. This will also allow us to use a similar workflow to what we use for Olm and sql.js WASM.

In later diffs, we'll need to:

  1. Add a package.json script that will build the WASM (the JS and WASM files)
  2. Update files in package.json to include all of the files we want in our published NPM package
  3. Write some JS code to do something like what locateFile does for Emscripten: allow the JS file to be passed a URI to the WASM file, rather than assuming the WASM filename. We need this so we can have a custom WASM filename so we can include the contenthash in the filename so that we can have immutable cache behavior

Note that this isn't an exhaustive list... I'm probably forgetting some steps, but I talked through more of the details in my last 1:1 with Jon, which we recorded.

Depends on D7149

Test Plan

I haven't really tested using this library. I did make sure yarn cleaninstall worked.

I worked on this with @jon in a 1:1, and I think the plan is for him to do some testing in follow-up diffs.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

A little out my expertise for best practcies, but looks good

This revision is now accepted and ready to land.Mar 23 2023, 11:59 AM

Note that I didn't bother adding a line here because @commapp/opaque-ke-wasm isn't actually consumed directly via Yarn workspaces, so we don't need its package.json in order to run yarn cleaninstall. Instead, we'll consume published versions of @commapp/opaque-ke-wasm as an NPM package.