-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use
n0-future
in favor of futures-*
libraries and `toki…
…o::{spawn,task,time}` (#3156) ## Description - replaces all imports of `futures_lite`, `futures_util`, `futures_sink` and `futures_buffered` with re-exports from `n0_future`. - replaces all imports of `std::time` with `n0_future::time` - replaces all occurrences of `tokio::{spawn,task,time}` with `n0_future::{spawn,task,time}` - **does not affect tests**: we use a bunch of special things there, like `tokio::time::advance` that we don't have n0-future yet. It's also not strictly necessary for shipping e.g. browser stuff. The goal of this PR is - to get us closer to browser compatibility (I've verified that I've replaced enough of all task spawning, etc. such that mostly cfg-ing out and other unrelated changes remain browser support) - to make the diffs of the browser-support PRs easier to follow Essentially this is work extracted out of the browser PRs. ## Breaking Changes I don't think there are any breaking changes from this. It's possible that `JoinSet` or `JoinHandle` types leak from the interfaces somewhere, but they're identical to the old ones (just re-exports) outside of `wasm*-*-unknown` targets. ## Notes & open questions I've tried setting up semgrep, but (1) IIUC, setting it up for CI requires that you have an account with them, only running locally is free and (2) I haven't found a way to ignore e.g. `std::time` imports when you're inside a `*::tests` module, which means we'd either need to convert all our tests to `n0-future` or ignore warnings and I think both of these options might suck. ## Change checklist - [x] Self-review. - [x] All breaking changes documented.
- Loading branch information
Showing
39 changed files
with
220 additions
and
229 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.