Enable Dependabot for Examples and Tools (#2785)

* Enable dependabot for examples and tools.

* Make everything to use Gloo.

* Require features for binaries.

* Update every Friday.
This commit is contained in:
Kaede Hoshikawa 2022-07-21 01:23:22 +09:00 committed by GitHub
parent 9d94f24a11
commit 924792c002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 2925 additions and 145 deletions

View File

@ -7,6 +7,20 @@ updates:
day: "friday"
open-pull-requests-limit: 5
- package-ecosystem: "cargo"
directory: "/examples"
schedule:
interval: "weekly"
day: "friday"
open-pull-requests-limit: 5
- package-ecosystem: "cargo"
directory: "/tools"
schedule:
interval: "weekly"
day: "friday"
open-pull-requests-limit: 5
- package-ecosystem: "npm"
directory: "/website"
schedule:

2
examples/.gitignore vendored
View File

@ -1,2 +1,4 @@
# trunk output
dist/
!Cargo.lock

2748
examples/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ edition = "2021"
license = "MIT OR Apache-2.0"
[dependencies]
gloo-console = "0.2"
gloo = "0.8"
js-sys = "0.3"
yew = { path = "../../packages/yew", features = ["csr"] }
wasm-bindgen = "0.2"

View File

@ -1,4 +1,4 @@
use gloo_console as console;
use gloo::console;
use js_sys::Date;
use yew::{html, Component, Context, Html};

View File

@ -11,7 +11,6 @@ yew = { path = "../../packages/yew", features = ["csr"] }
slab = "0.4.3"
gloo = "0.8"
wasm-bindgen = "0.2"
gloo-utils = "0.1"
[dependencies.web-sys]
version = "0.3.50"

View File

@ -1,4 +1,4 @@
use gloo_utils::document;
use gloo::utils::document;
use slab::Slab;
use web_sys::Element;
use yew::prelude::*;

View File

@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
js-sys = "0.3"
yew = { path = "../../packages/yew", features = ["csr"] }
gloo-file = "0.2"
gloo = "0.8"
[dependencies.web-sys]
version = "0.3"

View File

@ -1,7 +1,7 @@
use std::collections::HashMap;
use gloo_file::callbacks::FileReader;
use gloo_file::File;
use gloo::file::callbacks::FileReader;
use gloo::file::File;
use web_sys::{Event, HtmlInputElement};
use yew::html::TargetCast;
use yew::{html, Component, Context, Html};
@ -55,14 +55,14 @@ impl Component for App {
let link = ctx.link().clone();
if bytes {
gloo_file::callbacks::read_as_bytes(&file, move |res| {
gloo::file::callbacks::read_as_bytes(&file, move |res| {
link.send_message(Msg::LoadedBytes(
file_name,
res.expect("failed to read file"),
))
})
} else {
gloo_file::callbacks::read_as_text(&file, move |res| {
gloo::file::callbacks::read_as_text(&file, move |res| {
link.send_message(Msg::Loaded(
file_name,
res.unwrap_or_else(|e| e.to_string()),

View File

@ -11,7 +11,7 @@ rand = { version = "0.8", features = ["small_rng"] }
yew = { path = "../../packages/yew" }
yew-router = { path = "../../packages/yew-router" }
serde = { version = "1.0", features = ["derive"] }
gloo-timers = "0.2"
gloo = "0.8"
wasm-logger = "0.2"
instant = { version = "0.1", features = ["wasm-bindgen"] }
once_cell = "1"

View File

@ -1,6 +1,6 @@
use std::rc::Rc;
use gloo_timers::callback::Interval;
use gloo::timers::callback::Interval;
use instant::Instant;
use yew::prelude::*;

View File

@ -10,7 +10,7 @@ pulldown-cmark = { version = "0.9", default-features = false }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
yew = { path = "../../packages/yew", features = ["tokio", "csr"] }
gloo-utils = "0.1"
gloo = "0.8"
[dependencies.web-sys]
version = "0.3"

View File

@ -49,7 +49,7 @@ async fn fetch_markdown(url: &'static str) -> Result<String, FetchError> {
let request = Request::new_with_str_and_init(url, &opts)?;
let window = gloo_utils::window();
let window = gloo::utils::window();
let resp_value = JsFuture::from(window.fetch_with_request(&request)).await?;
let resp: Response = resp_value.dyn_into().unwrap();

View File

@ -15,4 +15,4 @@ log = "0.4"
rand = "0.8"
wasm-logger = "0.2"
yew = { path = "../../packages/yew", features = ["csr"] }
gloo-timers = "0.2"
gloo = "0.8"

View File

@ -1,5 +1,5 @@
use cell::Cellule;
use gloo_timers::callback::Interval;
use gloo::timers::callback::Interval;
use rand::Rng;
use yew::html::Scope;
use yew::{classes, html, Component, Context, Html};

View File

@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
gloo-utils = "0.1"
gloo = "0.8"
[dependencies.web-sys]
version = "0.3"

View File

@ -16,7 +16,7 @@ impl Component for App {
}
fn view(&self, _ctx: &Context<Self>) -> Html {
let div = gloo_utils::document().create_element("div").unwrap();
let div = gloo::utils::document().create_element("div").unwrap();
div.set_inner_html(HTML);
// See <https://github.com/yewstack/yew/issues/1546>
console::log_1(&div);

View File

@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
wasm-bindgen = "0.2"
yew = { path = "../../packages/yew", features = ["csr"] }
gloo-utils = "0.1"
gloo = "0.8"
[dependencies.web-sys]
version = "0.3"

View File

@ -60,7 +60,7 @@ fn create_canvas(document: &Document) -> HtmlCanvasElement {
}
fn main() {
let document = gloo_utils::document();
let document = gloo::utils::document();
let body = document.query_selector("body").unwrap().unwrap();
let canvas = create_canvas(&document);

View File

@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
gloo-utils = "0.1"
gloo = "0.8"
wasm-bindgen = "0.2"
[dependencies.web-sys]

View File

@ -33,7 +33,7 @@ impl Component for ShadowDOMHost {
.unchecked_into::<Element>()
.attach_shadow(&ShadowRootInit::new(ShadowRootMode::Open))
.expect("installing shadow root succeeds");
let inner_host = gloo_utils::document()
let inner_host = gloo::utils::document()
.create_element("div")
.expect("can create inner wrapper");
shadow_root
@ -82,7 +82,7 @@ impl Component for App {
type Properties = ();
fn create(_ctx: &Context<Self>) -> Self {
let document_head = gloo_utils::document()
let document_head = gloo::utils::document()
.head()
.expect("head element to be present");
let title_element = document_head

View File

@ -15,4 +15,4 @@ yew = { path = "../../packages/yew", features = ["csr"] }
yew-router = { path = "../../packages/yew-router" }
serde = { version = "1.0", features = ["derive"] }
once_cell = "1"
gloo-timers = "0.2"
gloo = "0.8"

View File

@ -1,4 +1,4 @@
use gloo_timers::callback::Interval;
use gloo::timers::callback::Interval;
use instant::Instant;
use yew::prelude::*;

View File

@ -4,6 +4,13 @@ version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "simple_ssr_hydrate"
required-features = ["hydration"]
[[bin]]
name = "simple_ssr_server"
required-features = ["ssr"]
[dependencies]
yew = { path = "../../packages/yew" }

View File

@ -5,6 +5,14 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "ssr_router_hydrate"
required-features = ["hydration"]
[[bin]]
name = "ssr_router_server"
required-features = ["ssr"]
[dependencies]
yew = { path = "../../packages/yew" }
function_router = { path = "../function_router" }

View File

@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
gloo-timers = { version = "0.2.2", features = ["futures"] }
gloo = { version = "0.8", features = ["futures"] }
wasm-bindgen-futures = "0.4"
wasm-bindgen = "0.2"

View File

@ -1,7 +1,7 @@
use std::rc::Rc;
use std::time::Duration;
use gloo_timers::future::sleep;
use gloo::timers::future::sleep;
use yew::prelude::*;
use yew::suspense::{Suspension, SuspensionResult};

View File

@ -7,4 +7,4 @@ license = "MIT OR Apache-2.0"
[dependencies]
yew = { path = "../../packages/yew", features = ["csr"] }
gloo-utils = "0.1"
gloo = "0.8"

View File

@ -70,7 +70,7 @@ impl Component for App {
}
fn mount_app(selector: &'static str) -> AppHandle<App> {
let document = gloo_utils::document();
let document = gloo::utils::document();
let element = document.query_selector(selector).unwrap().unwrap();
yew::Renderer::<App>::with_root(element).render()
}

View File

@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
js-sys = "0.3"
wasm-bindgen = "0.2"
yew = { path = "../../packages/yew", features = ["csr"] }
gloo-render = "0.1"
gloo = "0.8"
[dependencies.web-sys]
version = "0.3"

View File

@ -1,4 +1,4 @@
use gloo_render::{request_animation_frame, AnimationFrame};
use gloo::render::{request_animation_frame, AnimationFrame};
use wasm_bindgen::JsCast;
use web_sys::{HtmlCanvasElement, WebGlRenderingContext as GL};
use yew::html::Scope;

View File

@ -19,7 +19,6 @@ rust-version = "1.60.0"
[dependencies]
console_error_panic_hook = "0.1"
gloo = "0.8"
gloo-utils = "0.1.0"
indexmap = { version = "1", features = ["std"] }
js-sys = "0.3"
slab = "0.4"
@ -82,7 +81,6 @@ once_cell = "1"
[dev-dependencies]
wasm-bindgen-test = "0.3"
gloo = { version = "0.8", features = ["futures"] }
gloo-net = { version = "0.2", features = ["http"] }
wasm-bindgen-futures = "0.4"
rustversion = "1"
trybuild = "1"

View File

@ -181,7 +181,7 @@ mod feat_hydration {
mod tests {
use std::ops::Deref;
use gloo_utils::document;
use gloo::utils::document;
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
use web_sys::{Element, Node};

View File

@ -652,7 +652,7 @@ mod layout_tests_keys {
fn diff() {
let mut layouts = vec![];
let vref_node: Node = gloo_utils::document().create_element("i").unwrap().into();
let vref_node: Node = gloo::utils::document().create_element("i").unwrap().into();
layouts.push(TestLayout {
name: "All VNode types as children",
node: html! {

View File

@ -303,7 +303,7 @@ mod layout_tests {
#[test]
fn diff() {
let document = gloo_utils::document();
let document = gloo::utils::document();
let vref_node_1 = VNode::VRef(document.create_element("i").unwrap().into());
let vref_node_2 = VNode::VRef(document.create_element("b").unwrap().into());

View File

@ -135,10 +135,10 @@ mod layout_tests {
#[test]
fn diff() {
let mut layouts = vec![];
let first_target = gloo_utils::document().create_element("i").unwrap();
let second_target = gloo_utils::document().create_element("o").unwrap();
let target_with_child = gloo_utils::document().create_element("i").unwrap();
let target_child = gloo_utils::document().create_element("s").unwrap();
let first_target = gloo::utils::document().create_element("i").unwrap();
let second_target = gloo::utils::document().create_element("o").unwrap();
let target_with_child = gloo::utils::document().create_element("i").unwrap();
let target_child = gloo::utils::document().create_element("s").unwrap();
target_with_child.append_child(&target_child).unwrap();
layouts.push(TestLayout {

View File

@ -205,7 +205,7 @@ mod tests {
use web_sys::{Event, EventInit, FocusEvent, HtmlElement, MouseEvent};
wasm_bindgen_test_configure!(run_in_browser);
use gloo_utils::document;
use gloo::utils::document;
use wasm_bindgen::JsCast;
use yew::Callback;

View File

@ -8,7 +8,7 @@ use std::hint::unreachable_unchecked;
use std::ops::DerefMut;
use gloo::console;
use gloo_utils::document;
use gloo::utils::document;
use listeners::ListenerRegistration;
pub use listeners::Registry;
use wasm_bindgen::JsCast;
@ -386,7 +386,7 @@ mod feat_hydration {
#[cfg(target_arch = "wasm32")]
#[cfg(test)]
mod tests {
use gloo_utils::document;
use gloo::utils::document;
use wasm_bindgen::JsCast;
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
use web_sys::HtmlInputElement as InputElement;

View File

@ -1,7 +1,7 @@
//! This module contains the bundle implementation of text [BText].
use gloo::console;
use gloo_utils::document;
use gloo::utils::document;
use web_sys::{Element, Text as TextNode};
use super::{insert_node, BNode, BSubtree, Reconcilable, ReconcileTarget};

View File

@ -125,10 +125,10 @@ where
/// let counter_one = counter.clone();
/// use_effect(move || {
/// // Make a call to DOM API after component is rendered
/// gloo_utils::document().set_title(&format!("You clicked {} times", *counter_one));
/// gloo::utils::document().set_title(&format!("You clicked {} times", *counter_one));
///
/// // Perform the cleanup
/// || gloo_utils::document().set_title(&format!("You clicked 0 times"))
/// || gloo::utils::document().set_title(&format!("You clicked 0 times"))
/// });
///
/// let onclick = {

View File

@ -14,7 +14,7 @@ use crate::suspense::{Suspension, SuspensionResult};
#[cfg(target_arch = "wasm32")]
async fn decode_base64(s: &str) -> Result<Vec<u8>, JsValue> {
use gloo_utils::window;
use gloo::utils::window;
use js_sys::Uint8Array;
use wasm_bindgen::JsCast;
use wasm_bindgen_futures::JsFuture;

View File

@ -38,7 +38,7 @@ impl<T: 'static, F: FnOnce() -> T> Hook for UseMutRef<F> {
/// let message_count = use_mut_ref(|| 0);
///
/// let onclick = Callback::from(move |e| {
/// let window = gloo_utils::window();
/// let window = gloo::utils::window();
///
/// if *message_count.borrow_mut() > 3 {
/// window.alert_with_message("Message limit reached");

View File

@ -823,7 +823,7 @@ mod tests {
}
fn test_lifecycle(props: Props, expected: &[&str]) {
let document = gloo_utils::document();
let document = gloo::utils::document();
let scope = Scope::<Comp>::new(None);
let parent = document.create_element("div").unwrap();
let root = BSubtree::create_root(&parent);

View File

@ -220,7 +220,7 @@ pub fn create_portal(child: Html, host: Element) -> Html {
#[cfg(target_arch = "wasm32")]
#[cfg(test)]
mod tests {
use gloo_utils::document;
use gloo::utils::document;
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
use super::*;

View File

@ -73,7 +73,7 @@ where
/// Creates a [Renderer] that renders into the document body with custom properties.
pub fn with_props(props: COMP::Properties) -> Self {
Self::with_root_and_props(
gloo_utils::document()
gloo::utils::document()
.body()
.expect("no body node found")
.into(),

View File

@ -44,7 +44,7 @@ impl<T: fmt::Debug> fmt::Debug for UseFutureHandle<T> {
/// ```
/// # use yew::prelude::*;
/// # use yew::suspense::use_future;
/// use gloo_net::http::Request;
/// use gloo::net::http::Request;
///
/// const URL: &str = "https://en.wikipedia.org/w/api.php?\
/// action=query&origin=*&format=json&generator=search&\

View File

@ -39,7 +39,7 @@ pub struct TestLayout<'a> {
}
pub fn diff_layouts(layouts: Vec<TestLayout<'_>>) {
let document = gloo_utils::document();
let document = gloo::utils::document();
let scope: AnyScope = AnyScope::test();
let parent_element = document.create_element("div").unwrap();
let root = BSubtree::create_root(&parent_element);

View File

@ -1,14 +1,14 @@
#![allow(dead_code)]
pub fn obtain_result() -> String {
gloo_utils::document()
gloo::utils::document()
.get_element_by_id("result")
.expect("No result found. Most likely, the application crashed and burned")
.inner_html()
}
pub fn obtain_result_by_id(id: &str) -> String {
gloo_utils::document()
gloo::utils::document()
.get_element_by_id(id)
.expect("No result found. Most likely, the application crashed and burned")
.inner_html()

View File

@ -63,7 +63,7 @@ async fn hydration_works() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
sleep(Duration::ZERO).await;
@ -76,7 +76,7 @@ async fn hydration_works() {
r#"<div><div>Counter: 0<button class="increase">+1</button></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".increase")
.unwrap()
.unwrap()
@ -184,7 +184,7 @@ async fn hydration_with_suspense() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
sleep(Duration::from_millis(10)).await;
@ -207,7 +207,7 @@ async fn hydration_with_suspense() {
r#"<div class="content-area"><div class="actual-result">0</div><button class="increase">increase</button><div class="action-area"><button class="take-a-break">Take a break!</button></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".increase")
.unwrap()
.unwrap()
@ -223,7 +223,7 @@ async fn hydration_with_suspense() {
r#"<div class="content-area"><div class="actual-result">1</div><button class="increase">increase</button><div class="action-area"><button class="take-a-break">Take a break!</button></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".take-a-break")
.unwrap()
.unwrap()
@ -340,7 +340,7 @@ async fn hydration_with_suspense_not_suspended_at_start() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
sleep(Duration::from_millis(10)).await;
@ -351,7 +351,7 @@ async fn hydration_with_suspense_not_suspended_at_start() {
result.as_str(),
r#"<div class="content-area"><textarea>I am writing a long story...</textarea><div class="action-area"><button class="take-a-break">Take a break!</button></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".take-a-break")
.unwrap()
.unwrap()
@ -471,7 +471,7 @@ async fn hydration_nested_suspense_works() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
// outer suspense is hydrating...
@ -500,7 +500,7 @@ async fn hydration_nested_suspense_works() {
r#"<div class="content-area"><div class="action-area"><button class="take-a-break">Take a break!</button></div><div class="content-area"><div class="action-area"><button class="take-a-break2">Take a break!</button></div></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".take-a-break")
.unwrap()
.unwrap()
@ -521,7 +521,7 @@ async fn hydration_nested_suspense_works() {
r#"<div class="content-area"><div class="action-area"><button class="take-a-break">Take a break!</button></div><div class="content-area"><div class="action-area"><button class="take-a-break2">Take a break!</button></div></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".take-a-break2")
.unwrap()
.unwrap()
@ -608,7 +608,7 @@ async fn hydration_node_ref_works() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
sleep(Duration::ZERO).await;
@ -619,7 +619,7 @@ async fn hydration_node_ref_works() {
r#"<div><span>test</span><span>test</span><span>test</span><span>test</span></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector("span")
.unwrap()
.unwrap()
@ -701,7 +701,7 @@ async fn hydration_list_order_works() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
// Wait until all suspended components becomes revealed.
@ -784,7 +784,7 @@ async fn hydration_suspense_no_flickering() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
// Wait until all suspended components becomes revealed.
@ -897,7 +897,7 @@ async fn hydration_order_issue_nested_suspense() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
// Wait until all suspended components becomes revealed.

View File

@ -70,7 +70,7 @@ async fn change_nested_after_append() {
}
}
yew::Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
yew::Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.render();
sleep(Duration::from_millis(100)).await;

View File

@ -29,7 +29,7 @@ async fn props_are_passed() {
}
yew::Renderer::<PropsComponent>::with_root_and_props(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
PropsPassedFunctionProps {
value: "props".to_string(),
},

View File

@ -97,7 +97,7 @@ async fn suspense_works() {
}
}
yew::Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
yew::Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.render();
TimeoutFuture::new(10).await;
@ -114,7 +114,7 @@ async fn suspense_works() {
TimeoutFuture::new(10).await;
gloo_utils::document()
gloo::utils::document()
.query_selector(".increase")
.unwrap()
.unwrap()
@ -124,7 +124,7 @@ async fn suspense_works() {
TimeoutFuture::new(0).await;
gloo_utils::document()
gloo::utils::document()
.query_selector(".increase")
.unwrap()
.unwrap()
@ -140,7 +140,7 @@ async fn suspense_works() {
r#"<div class="content-area"><div class="actual-result">2</div><button class="increase">increase</button><div class="action-area"><button class="take-a-break">Take a break!</button></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".take-a-break")
.unwrap()
.unwrap()
@ -247,7 +247,7 @@ async fn suspense_not_suspended_at_start() {
}
}
yew::Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
yew::Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.render();
TimeoutFuture::new(10).await;
@ -257,7 +257,7 @@ async fn suspense_not_suspended_at_start() {
result.as_str(),
r#"<div class="content-area"><textarea></textarea><div class="action-area"><button class="take-a-break">Take a break!</button></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".take-a-break")
.unwrap()
.unwrap()
@ -366,7 +366,7 @@ async fn suspense_nested_suspense_works() {
}
}
yew::Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
yew::Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.render();
TimeoutFuture::new(10).await;
@ -389,7 +389,7 @@ async fn suspense_nested_suspense_works() {
r#"<div class="content-area"><div class="action-area"><button class="take-a-break">Take a break!</button></div><div class="content-area"><div class="action-area"><button class="take-a-break2">Take a break!</button></div></div></div>"#
);
gloo_utils::document()
gloo::utils::document()
.query_selector(".take-a-break2")
.unwrap()
.unwrap()
@ -523,7 +523,7 @@ async fn effects_not_run_when_suspended() {
};
yew::Renderer::<App>::with_root_and_props(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
props,
)
.render();
@ -544,7 +544,7 @@ async fn effects_not_run_when_suspended() {
TimeoutFuture::new(10).await;
gloo_utils::document()
gloo::utils::document()
.query_selector(".increase")
.unwrap()
.unwrap()
@ -554,7 +554,7 @@ async fn effects_not_run_when_suspended() {
TimeoutFuture::new(0).await;
gloo_utils::document()
gloo::utils::document()
.query_selector(".increase")
.unwrap()
.unwrap()
@ -571,7 +571,7 @@ async fn effects_not_run_when_suspended() {
);
assert_eq!(*counter.borrow(), 3); // effects ran 3 times.
gloo_utils::document()
gloo::utils::document()
.query_selector(".take-a-break")
.unwrap()
.unwrap()
@ -622,7 +622,7 @@ async fn use_suspending_future_works() {
}
}
yew::Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
yew::Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.render();
TimeoutFuture::new(10).await;
@ -672,7 +672,7 @@ async fn use_suspending_future_with_deps_works() {
}
}
yew::Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
yew::Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.render();
TimeoutFuture::new(10).await;

View File

@ -61,7 +61,7 @@ async fn use_callback_works() {
}
yew::Renderer::<UseCallbackComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();

View File

@ -65,7 +65,7 @@ async fn use_context_scoping_works() {
}
yew::Renderer::<UseContextComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
@ -148,7 +148,7 @@ async fn use_context_works_with_multiple_types() {
}
yew::Renderer::<TestComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
@ -248,7 +248,7 @@ async fn use_context_update_works() {
}
yew::Renderer::<TestComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();

View File

@ -68,7 +68,7 @@ async fn use_effect_destroys_on_component_drop() {
let destroy_counter = Rc::new(std::cell::RefCell::new(0));
let destroy_counter_c = destroy_counter.clone();
yew::Renderer::<UseEffectWrapperComponent>::with_root_and_props(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
WrapperProps {
destroy_called: Rc::new(move || *destroy_counter_c.borrow_mut().deref_mut() += 1),
},
@ -107,7 +107,7 @@ async fn use_effect_works_many_times() {
}
yew::Renderer::<UseEffectComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
@ -141,7 +141,7 @@ async fn use_effect_works_once() {
}
yew::Renderer::<UseEffectComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
sleep(Duration::ZERO).await;
@ -189,7 +189,7 @@ async fn use_effect_refires_on_dependency_change() {
}
yew::Renderer::<UseEffectComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();

View File

@ -50,7 +50,7 @@ async fn use_memo_works() {
}
yew::Renderer::<UseMemoComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();

View File

@ -53,7 +53,7 @@ async fn use_prepared_state_works() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
sleep(Duration::from_millis(100)).await;
@ -103,7 +103,7 @@ async fn use_prepared_state_with_suspension_works() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
sleep(Duration::from_millis(100)).await;

View File

@ -5,7 +5,7 @@ use std::rc::Rc;
use std::time::Duration;
use gloo::timers::future::sleep;
use gloo_utils::document;
use gloo::utils::document;
use wasm_bindgen::JsCast;
use wasm_bindgen_test::*;
use web_sys::HtmlElement;
@ -57,7 +57,7 @@ async fn use_reducer_works() {
}
yew::Renderer::<UseReducerComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
sleep(Duration::ZERO).await;

View File

@ -32,7 +32,7 @@ async fn use_ref_works() {
}
yew::Renderer::<UseRefComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
sleep(Duration::ZERO).await;

View File

@ -29,7 +29,7 @@ async fn use_state_works() {
}
yew::Renderer::<UseComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
sleep(Duration::ZERO).await;
@ -72,7 +72,7 @@ async fn multiple_use_state_setters() {
}
yew::Renderer::<UseComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
sleep(Duration::ZERO).await;
@ -101,7 +101,7 @@ async fn use_state_eq_works() {
}
yew::Renderer::<UseComponent>::with_root(
gloo_utils::document().get_element_by_id("output").unwrap(),
gloo::utils::document().get_element_by_id("output").unwrap(),
)
.render();
sleep(Duration::ZERO).await;

View File

@ -53,7 +53,7 @@ async fn use_transitive_state_works() {
sleep(Duration::ZERO).await;
Renderer::<App>::with_root(gloo_utils::document().get_element_by_id("output").unwrap())
Renderer::<App>::with_root(gloo::utils::document().get_element_by_id("output").unwrap())
.hydrate();
sleep(Duration::from_millis(100)).await;

76
tools/Cargo.lock generated
View File

@ -81,9 +81,9 @@ checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3"
[[package]]
name = "bytes"
version = "1.1.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e"
[[package]]
name = "cc"
@ -131,9 +131,9 @@ dependencies = [
[[package]]
name = "clap"
version = "3.2.8"
version = "3.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83"
checksum = "ac2bd7a1eb07da9ac757c923f69373deb7bc2ba5efc951b873bcb5e693992dca"
dependencies = [
"atty",
"bitflags",
@ -604,9 +604,9 @@ dependencies = [
[[package]]
name = "hashbrown"
version = "0.12.1"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
@ -668,9 +668,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "hyper"
version = "0.14.19"
version = "0.14.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f"
checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac"
dependencies = [
"bytes",
"futures-channel",
@ -716,9 +716,9 @@ dependencies = [
[[package]]
name = "implicit-clone"
version = "0.3.1"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0471b76ef1d0d1d3887a5fab377780566d274dc13dd2a1dfbbf251fa8cb6a3a"
checksum = "a937e630d3907d421944abd8edb5288936f1fde83aaaf1a8c6c89bb4222f0677"
dependencies = [
"indexmap",
]
@ -934,15 +934,15 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.12.0"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]]
name = "openssl"
version = "0.10.40"
version = "0.10.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e"
checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0"
dependencies = [
"bitflags",
"cfg-if",
@ -972,9 +972,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-sys"
version = "0.9.74"
version = "0.9.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1"
checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f"
dependencies = [
"autocfg",
"cc",
@ -985,9 +985,9 @@ dependencies = [
[[package]]
name = "os_str_bytes"
version = "6.1.0"
version = "6.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa"
checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4"
[[package]]
name = "percent-encoding"
@ -1041,9 +1041,9 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
[[package]]
name = "prettyplease"
version = "0.1.15"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1516508b396cefe095485fdce673007422f5e48e82934b7b423dc26aa5e6a4"
checksum = "da6ffbe862780245013cb1c0a48c4e44b7d665548088f91f6b90876d0625e4c2"
dependencies = [
"proc-macro2",
"syn",
@ -1141,9 +1141,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.5.6"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1"
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
dependencies = [
"aho-corasick",
"memchr",
@ -1152,9 +1152,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.26"
version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "remove_dir_all"
@ -1219,9 +1219,9 @@ dependencies = [
[[package]]
name = "rustversion"
version = "1.0.7"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0a5f7c728f5d284929a1cccb5bc19884422bfe6ef4d6c409da2c41838983fcf"
checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8"
[[package]]
name = "ryu"
@ -1276,9 +1276,9 @@ checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1"
[[package]]
name = "serde"
version = "1.0.138"
version = "1.0.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47"
checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6"
dependencies = [
"serde_derive",
]
@ -1297,9 +1297,9 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.138"
version = "1.0.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c"
checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb"
dependencies = [
"proc-macro2",
"quote",
@ -1331,9 +1331,12 @@ dependencies = [
[[package]]
name = "slab"
version = "0.4.6"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32"
checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef"
dependencies = [
"autocfg",
]
[[package]]
name = "socket2"
@ -1461,10 +1464,11 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.19.2"
version = "1.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439"
checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e"
dependencies = [
"autocfg",
"bytes",
"libc",
"memchr",
@ -1564,9 +1568,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
[[package]]
name = "unicode-ident"
version = "1.0.1"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c"
checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
[[package]]
name = "unicode-normalization"