[web] Scaffolding for opaque-ke-wasm project
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:
- Add a package.json script that will build the WASM (the JS and WASM files)
- Update files in package.json to include all of the files we want in our published NPM package
- 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.
Reviewers: jon, varun, atul
Reviewed By: jon
Subscribers: tomek, jon
Differential Revision: https://phab.comm.dev/D7150