-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Separate Yew Platform #2893
Merged
Merged
Separate Yew Platform #2893
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6992ada
Remove pinned module.
futursolo ae41979
Create Yew Platform.
futursolo efb5ae4
Remove some additional dependencies.
futursolo e6c7e1e
Fix clippy.
futursolo 7c91aff
Restore wasm-bindgen-futures.
futursolo eac2f19
Fix docs.
futursolo f62a737
Migrate to prokio.
futursolo 95509cc
Merge branch 'master' into platform-crate
futursolo 9b03269
Fix docs warnings.
futursolo 680590b
Fix dependencies.
futursolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[package] | ||
name = "yew-platform" | ||
version = "0.1.0" | ||
authors = ["Kaede Hoshikawa <futursolo@icloud.com>"] | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
readme = "README.md" | ||
keywords = ["yew", "futures", "async", "io"] | ||
categories = ["asynchronous"] | ||
description = "Yew's asynchronous runtime." | ||
repository = "https://github.com/yewstack/yew" | ||
rust-version = "1.60.0" | ||
|
||
[dependencies] | ||
gloo = "0.8" | ||
futures = { version = "0.3", default-features = false, features = ["std", "async-await"] } | ||
pin-project = "1.0.11" | ||
pinned = "0.1.0" | ||
|
||
[target.'cfg(target_arch = "wasm32")'.dependencies] | ||
# we move wasm-bindgen here so no promise-based spawn_local can present for | ||
# non-wasm32 targets. | ||
wasm-bindgen-futures = "0.4" | ||
|
||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
num_cpus = { version = "1.13", optional = true } | ||
once_cell = "1" | ||
tokio = { version = "1.21.1", features = ["rt", "time"], optional = true } | ||
tokio-stream = { version = "0.1", features = ["time"], optional = true } | ||
|
||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] | ||
tokio = { version = "1.19", features = ["full"] } | ||
|
||
[features] | ||
tokio = ["dep:tokio", "dep:num_cpus", "dep:tokio-stream"] | ||
default = [] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "documenting"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# yew-platform | ||
|
||
Runtime for the [Yew](https://github.com/yewstack/yew) framework. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! Task synchronisation primitives for pinned tasks. | ||
//! | ||
//! This module provides the following task synchronisation mechanisms for `!Send` futures: | ||
futursolo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
//! | ||
//! - [`Barrier`]: Ensures multiple tasks to wait until all tasks have reached a point in the | ||
//! program before continuing execution of all together. | ||
//! - [`RwLock`]: Provides a mutual exclusion mechanism which allows multiple readers at the same | ||
//! time, while allowing only one writer at a time. | ||
//! - [`mpsc`]: A channel that supports sending multiple values from multiple producers to a single | ||
//! receiver. | ||
//! - [`oneshot`]: A channel to send one single value from a producer to a receiver. | ||
|
||
#[doc(inline)] | ||
pub use pinned::*; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we dropped the
yew-
prefix from here? It can be generic crate that can be used to pick an async runtime between tokio and wasm-bindgen-futures (JS promises)Name idea: promise + tokio = prokio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I have published the crate under name
prokio
.