HomePhabricator
Diffusion Comm ede918e1a6f5

[web] Scaffolding for opaque-ke-wasm project

Description

[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:

  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.

Reviewers: jon, varun, atul

Reviewed By: jon

Subscribers: tomek, jon

Differential Revision: https://phab.comm.dev/D7150

Details

Provenance
ashoatAuthored on Mar 22 2023, 4:18 PM
Reviewer
jon
Differential Revision
D7150: [web] Scaffolding for opaque-ke-wasm project
Parents
rCOMM4559bf844167: [web] Add grpc-web@1.4.2
Branches
Unknown
Tags
Unknown