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

Export worker class to JavaScript #71

Merged
merged 7 commits into from Sep 24, 2021
Merged

Conversation

antiphoton
Copy link
Collaborator

@antiphoton antiphoton commented Sep 22, 2021

Export a WasmWorker class to JavaScript. Hence JavaScript developers are able to construct multiple WasmWorker instances for different domains.

  • Remove most functions in cloudflare_worker/src/*.rs. They are now member methods of class WasmWorker.
  • Remove dependencies in cloudflare_worker/Cargo.toml.
  • Remove the SxgWorker global variable in cloudflare_worker/src/lib.rs. it is now a WasmWorker global variable in TypeScript.
  • Remove get_last_error_message.
  • Change constructor of SxgWorker to return a Result.

Closes #46

cloudflare_worker/worker/src/wasmFunctions.ts Show resolved Hide resolved
sxg_rs/src/lib.rs Outdated Show resolved Hide resolved
sxg_rs/src/wasm_worker.rs Outdated Show resolved Hide resolved
sxg_rs/src/utils.rs Outdated Show resolved Hide resolved
sxg_rs/src/wasm_worker.rs Outdated Show resolved Hide resolved
sxg_rs/src/wasm_worker.rs Show resolved Hide resolved
cloudflare_worker/worker/src/wasmFunctions.ts Outdated Show resolved Hide resolved
cloudflare_worker/worker/src/wasmFunctions.ts Outdated Show resolved Hide resolved
sxg_rs/src/utils.rs Outdated Show resolved Hide resolved
cloudflare_worker/worker/src/wasmFunctions.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export constructor of SxgWorker to WebAssembly
2 participants