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

Switch over to Tokio ecosystem #105

Closed
wants to merge 19 commits into from
Closed

Conversation

ranile
Copy link
Contributor

@ranile ranile commented Jan 4, 2021

This pull request

  • Switches from async_std to tokio
    As a result,
    • Replaces tide with warp
    • Adds support for web socket proxy

This should also help with #4 as there is support for web sockets.

There has been a change in proxy API. proxy-rewrite is replaced with proxy-path. Now, proxy-path denotes the route where trunk will listen.

Fixes: #81, #95, #53

Checklist

  • Updated CHANGELOG.md describing pertinent changes.
  • Updated README.md with pertinent info (may not always apply).

Copy link
Contributor

@rakshith-ravi rakshith-ravi left a comment

Choose a reason for hiding this comment

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

I don't know enough about warp to review that. So I'll leave @thedodd to handle that part of it

Cargo.toml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
src/common.rs Show resolved Hide resolved
src/config/manifest.rs Outdated Show resolved Hide resolved
src/config/rt.rs Outdated Show resolved Hide resolved
src/pipelines/html.rs Outdated Show resolved Hide resolved
src/pipelines/html.rs Outdated Show resolved Hide resolved
src/pipelines/mod.rs Show resolved Hide resolved
@ranile
Copy link
Contributor Author

ranile commented Jan 20, 2021

I've updated to Tokio 1.0 so this PR is ready to be reviewed, I don't foresee any more changes

CC: @thedodd, @rakshith-ravi

@ranile ranile mentioned this pull request Jan 23, 2021
Copy link
Member

@thedodd thedodd left a comment

Choose a reason for hiding this comment

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

@hamza1311 hey boss, thanks for all of the great work here. I'm actually not done with the review yet, but I wanted to give you some early feedback. I'll finish up the remainder of the PR review soon.

I would definitely love to get this released as part of 0.8 (the next release).

CHANGELOG.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Trunk.toml Outdated Show resolved Hide resolved
src/config/models.rs Outdated Show resolved Hide resolved
src/config/rt.rs Outdated Show resolved Hide resolved
@vtenfys vtenfys mentioned this pull request Feb 2, 2021
2 tasks
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	src/build.rs
#	src/config/manifest.rs
#	src/config/rt.rs
#	src/pipelines/copydir.rs
#	src/pipelines/rust_app.rs
#	src/serve.rs
#	src/watch.rs
Copy link
Contributor

@rakshith-ravi rakshith-ravi left a comment

Choose a reason for hiding this comment

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

Love the work, @hamza1311. Thank you for doing this. Just a few small nitpicks here and there. Otherwise, looks good to me 🎉

Cargo.toml Outdated Show resolved Hide resolved
src/build.rs Outdated Show resolved Hide resolved
src/build.rs Show resolved Hide resolved
rakshith-ravi
rakshith-ravi previously approved these changes Feb 2, 2021
Copy link
Contributor

@rakshith-ravi rakshith-ravi left a comment

Choose a reason for hiding this comment

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

Thank you so much @hamza1311

@thedodd
Copy link
Member

thedodd commented Feb 14, 2021

@hamza1311 I'm in the process of adding an update merge to your branch here, and I'll make a few other changes (instead of going through the review process) :). Hopefully that will help us to get this merged more quickly.

The primary motivation behind these changes is to address the issue with
the `nipper` crate exposing primarily !Send + !Sync types. The only
pipeline which needs to deal with these types is now the HTML pipeline.
All other pipelines receive a data-only representation of the original
HTML.
Copy link
Member

@thedodd thedodd left a comment

Choose a reason for hiding this comment

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

@hamza1311 ok, I've finished up a round of changes/updates on the code. Definitely take a look at the code & commit messages. Nothing too crazy, though one of the commits involved some refactoring just to enable the use of local_spawn.

Overall, everything is ready to go except for the proxy code. It needs some work still. There are unwraps in the code, and I do not want to drop stacktraces on Trunk users. We've got a few options:

  • I'm happy to go in and refactor that code. There are a few simple changes we can make to some of the warp handler functions to have them use a custom error type which wraps an anyhow::Error — which I've used quite successfully in a few of my other projects which use Warp. That will allow us to propagate errors normally instead of unwrapping/panicking.
  • Feel free to make those changes yourself, though I should have time to finish this up over the next few days as well. Just ping me if you start hacking on the changes. I'll do the same.

@ranile
Copy link
Contributor Author

ranile commented Feb 20, 2021

@thedodd, I removed the unwraps and justified why its safe to do (where it's safe). Feel free to take a look.

@thedodd
Copy link
Member

thedodd commented Mar 4, 2021

Ok, I should have the final changes for this PR finished up tonight.

@thedodd thedodd mentioned this pull request Mar 4, 2021
2 tasks
@thedodd thedodd closed this in #137 Mar 5, 2021
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.

Switch away from tide web server
3 participants