Page MenuHomePhabricator

[web] add database module to worker
ClosedPublic

Authored by kamil on Jun 30 2023, 8:14 AM.
Tags
None
Referenced Files
F3247302: D8394.id28415.diff
Fri, Nov 15, 4:37 AM
Unknown Object (File)
Fri, Oct 18, 9:01 AM
Unknown Object (File)
Fri, Oct 18, 9:01 AM
Unknown Object (File)
Fri, Oct 18, 9:01 AM
Unknown Object (File)
Fri, Oct 18, 9:01 AM
Unknown Object (File)
Fri, Oct 18, 9:01 AM
Unknown Object (File)
Fri, Oct 18, 9:00 AM
Unknown Object (File)
Fri, Oct 18, 8:51 AM
Subscribers

Details

Summary

Adding logic to use .wasm module on web.

Test Plan

Check if result is properly logged from web in prod/dev and desktop.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
web/database/worker/db-worker.js
80 ↗(On Diff #28302)

types will be added in subsequent diff

kamil published this revision for review.Jun 30 2023, 8:59 AM
keyserver/src/responders/website-responders.js
97 ↗(On Diff #28306)

The other properties have Filename as one word. Would be good to maintain consistency

keyserver/src/responders/website-responders.js
138 ↗(On Diff #28306)

Can we try to match the convention of comm_opaque2_wasm_bg.wasm? So I guess it would be comm_query_executor.wasm

web/database/worker/db-worker.js
69 ↗(On Diff #28306)

Is this console.log accidentally left over from testing? If not, and you want to keep it, we should probably add some additional context to the message

Looks ok, but please address the comments.

This revision is now accepted and ready to land.Jul 5 2023, 2:17 AM

improve naming convention

keyserver/src/responders/website-responders.js
97 ↗(On Diff #28306)

done!

138 ↗(On Diff #28306)

We have two options:

  1. Generate files named comm_query_executor.*, but then in JS we will have to include import Module from '../_generated/comm_query_executor.js'; which doesn't really match including convention.
  2. Generate files named comm-query-executor.* and rename .wasm file to comm_query_executor.wasm, but we will have to hardcode the default filename from locateFile() callback because it has comm-query-executor.wasm set as default.

I implemented option 2.

web/database/worker/db-worker.js
69 ↗(On Diff #28306)

left over, should've never been committed, removing

keyserver/src/responders/website-responders.js
138 ↗(On Diff #28306)

Makes sense!

This revision was automatically updated to reflect the committed changes.