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

WASM support #322

Closed
bikeshedder opened this issue May 7, 2024 · 5 comments
Closed

WASM support #322

bikeshedder opened this issue May 7, 2024 · 5 comments
Labels
A-core Area: Core / deadpool A-postgres Area: PostgreSQL support / deadpool-postgres enhancement New feature or request O-wasm Operating System: WASM

Comments

@bikeshedder
Copy link
Owner

This issue tracks the progress of supporting WASM as a target.

@bikeshedder bikeshedder added enhancement New feature or request A-core Area: Core / deadpool A-postgres Area: PostgreSQL support / deadpool-postgres O-wasm Operating System: WASM labels May 7, 2024
@bikeshedder
Copy link
Owner Author

@shadaj Continuing our discussion from #316. I'm unsure if that's actually a case of rust-lang/cargo#1197.

If I'm not mistaken the conditional dependencies should work just fine with the latest Rust edition and resolver. 🤔

Alternatively we could add a rt-tokio-1-wasm feature which does enable deadpool/rt-tokio-1 but not the runtime feature of the tokio-postgres crate. That way we could still keep it a single feature to enable for most of the users and only add a special WASM feature flag for WASM users.

As features are additive it would be best if this was "fixed" in tokio-postgres where the runtime becomes a no-op if compiling for WASM.

@sfackler, what are your thoughts on that?

@bikeshedder
Copy link
Owner Author

@shadaj btw. would you be willing to share some of the code you use to create connection to PostgreSQL with WASM? Could that actually be added to a WASM specific runtime feature to tokio-postgres or deadpool-postgres? That would make using PostgreSQL on WASM a lot easier for future developers, no?

@bikeshedder
Copy link
Owner Author

I just released 📦 deadpool 0.12.1 and 📦 deadpool-postgres 0.13.2. I had to make a release due to #320 and including the current feature guards shouldn't break anything even though WASM support is currently broken according to @shadaj.

@shadaj
Copy link
Contributor

shadaj commented May 7, 2024

Ahhhhh, we had forgotten to include resolver = "2" in a downstream crate we're building with wasm-pack. So sorry for the confusion, it all works now! Will look into sharing some of the connection code we use for WASM.

@bikeshedder
Copy link
Owner Author

Great. So this can be closed. The just released versions of the crates fix this. 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core / deadpool A-postgres Area: PostgreSQL support / deadpool-postgres enhancement New feature or request O-wasm Operating System: WASM
Projects
None yet
Development

No branches or pull requests

2 participants