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

feat(wasm): enable wasm32-unknown-unknown compilation of query connectors, query core, and request handlers #4120

Closed

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Aug 7, 2023

Proceeding with the work started in #4119, this PR enables compiling every local dependency up to request-handlers to WebAssembly (wasm32-uknown-unknown).

cd query-engine/request-handlers
cargo build --target wasm32-unknown-unknown --no-default-features
  • In the prisma-models crate, we removed cuid from the wasm_generator feature flag, so that it won't be compiled (as it depends on hostname, which is not available in WebAssembly).
  • For crates that indirectly depends on getrandom, we added the js feature flag to make it Wasm-compatible.
  • For query core, query connector, and request handler crates, we added the native-connectors feature flag for enabling native (e.g., darwin-arm64) compilation.
  • To avoid runtime errors in Wasm with std::time::Instant (which is not supported in every Wasm interpreter, e.g., in browsers), we provide a shim (instant).

This PR closes https://github.com/prisma/team-orm/issues/280, https://github.com/prisma/team-orm/issues/281, https://github.com/prisma/team-orm/issues/282, https://github.com/prisma/team-orm/issues/283.

The original PR is at: #4117.

@jkomyno jkomyno changed the base branch from main to jkomyno/quaint-wasm August 7, 2023 23:17
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 7, 2023

CodSpeed Performance Report

Merging #4120 will not alter performance

Comparing jkomyno/refactor-up-to-request-handlers (74af6f1) with jkomyno/quaint-wasm (81fc17b)

Summary

✅ 11 untouched benchmarks

@jkomyno jkomyno changed the title [helper PR from Neon's fork] compile query connectors, query core, and request handlers to wasm feat(wasm): enable wasm32-unknown-unknown compilation of query connectors, query core, and request handlers Aug 14, 2023
@jkomyno jkomyno added this to the 5.2.0 milestone Aug 14, 2023
@jkomyno jkomyno marked this pull request as ready for review August 14, 2023 17:42
@jkomyno jkomyno requested a review from a team as a code owner August 14, 2023 17:42
@aqrln aqrln modified the milestones: 5.2.0, 5.3.0 Aug 22, 2023
@janpio janpio added the topic: edge functions formerly phase 2 label Sep 26, 2023
@jkomyno jkomyno closed this Nov 20, 2023
@jkomyno jkomyno removed their assignment Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: edge functions formerly phase 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants