Skip to content

Add tokio feature & make tokio optional for WASM support#1382

Merged
davidpdrsn merged 13 commits into
tokio-rs:mainfrom
logankeenan:feat/optional-tokio
Sep 25, 2022
Merged

Add tokio feature & make tokio optional for WASM support#1382
davidpdrsn merged 13 commits into
tokio-rs:mainfrom
logankeenan:feat/optional-tokio

Conversation

@logankeenan

Copy link
Copy Markdown
Contributor

Motivation

This PR is a continuation of @fisherdarling's PR since they are very busy and don't have time to see it through at the moment.

It allows Axum to be compiled to WASM, therefore, executable in a browser, Cloudflare Worker, etc...

Solution

This PR adds a tokio feature that enables tokio as well as hyper/tcp and hyper/server. The tokio feature also enables SSE and extract::connect_info.

This is a breaking change since this breaks usages of default_features = false.

Comment thread examples/simple-router-wasm/src/main.rs
Comment thread examples/simple-router-wasm/src/main.rs Outdated
Comment thread axum/Cargo.toml Outdated
@davidpdrsn

Copy link
Copy Markdown
Member

@logankeenan fyi I've started committing to this a bit, so plz don't force push 🙏

@davidpdrsn davidpdrsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @fisherdarling and @logankeenan for working on this. I did some final touch ups and this is good to merge 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants