From 36df1af9fafeb0f34dac323e3f4178dac690afd7 Mon Sep 17 00:00:00 2001 From: allan2 Date: Thu, 20 May 2021 23:17:15 -0230 Subject: [PATCH 1/3] Fix broken references to yew_services Update the `use` statement in the Fetch example. Fix the broken links to Rust docs. Improve wording. --- docs/concepts/services/fetch.md | 8 ++++---- docs/more/debugging.md | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/concepts/services/fetch.md b/docs/concepts/services/fetch.md index 7b96625f6bd..34775d6a2e6 100644 --- a/docs/concepts/services/fetch.md +++ b/docs/concepts/services/fetch.md @@ -26,7 +26,7 @@ pub type Binary = Result, Error>; Here is what a typical GET request will look like: ```rust use yew::format::Nothing; -use yew_services::fetch::Request; +use yew::services::fetch::Request; let get_request = Request::get("https://example.com/api/v1/get/something") .body(Nothing) .expect("Could not build that request"); @@ -36,7 +36,7 @@ Here is what a typical POST request will look like: ```rust use serde_json::json; use yew::format::Json; -use yew_services::fetch::Request; +use yew::services::fetch::Request; let post_request = Request::post("https://example.com/api/v1/post/something") .header("Content-Type", "application/json") .body(Json(&json!({"key": "value"}))) @@ -95,7 +95,7 @@ An illustrated example of how to fetch data from an API giving information about use serde::Deserialize; use yew::{format::{Json, Nothing}, prelude::*}; -use yew_services::fetch::{FetchService, FetchTask, Request, Response}; +use yew::services::fetch::{FetchService, FetchTask, Request, Response}; #[derive(Deserialize, Debug, Clone)] pub struct ISSPosition { @@ -238,6 +238,6 @@ The Rust Wasm Book also contains [useful debugging tips](https://rustwasm.github for Wasm applications. ## Further reading -* [The API documentation](https://docs.rs/yew-services/latest/yew_services/fetch/index.html) +* [The API documentation](https://docs.rs/yew/latest/yew/services/fetch/index.html) * The [dashboard](https://github.com/yewstack/yew/tree/master/examples/dashboard) example. * [The Rust Wasm Book on debugging Wasm applications](https://rustwasm.github.io/book/reference/debugging.html) diff --git a/docs/more/debugging.md b/docs/more/debugging.md index 20498c2b128..1525aa56c0a 100644 --- a/docs/more/debugging.md +++ b/docs/more/debugging.md @@ -5,12 +5,12 @@ title: Debugging ## Panics The [`console_error_panic`](https://github.com/rustwasm/console_error_panic_hook) crate catches -`panic!`s and outputs them to the console. Yew will automatically catch `panic!`s and log them to -your browser's console. +`panic!`s and outputs them to the console. Yew automatically catches `panic!`s and logs them to +the browser console. ## Console Logging -In general, Wasm web apps are able to interact with Browser APIs, and the `console.log` API is no +In general, Wasm web apps are able to interact with Browser APIs. The `console.log` API is no exception. There are a few options available: ### [`wasm-logger`](https://crates.io/crates/wasm-logger) @@ -27,9 +27,9 @@ fn main() { log::info!("Update: {:?}", msg); ``` -### [`ConsoleService`](https://docs.rs/yew-services/latest/yew_services/struct.ConsoleService.html) +### [`ConsoleService`](https://docs.rs/yew/latest/yew/services/console/struct.ConsoleService.html) -This service is included within the [`yew-services`](https://crates.io/crates/yew-services) crate: +This service is included with Yew. ```rust // usage @@ -38,7 +38,7 @@ ConsoleService::info(format!("Update: {:?}", msg)); ## Source Maps -There is currently no first-class support for source maps for Rust / Wasm web apps. This, of course, is subject to change. If this is no longer true or if progress is made, please suggest a change! +There is currently no first-class support for source maps for Rust/Wasm web apps. This could change in the future. ### Latest Info From 570da967017daf328726dd1da1a882db9500a5b2 Mon Sep 17 00:00:00 2001 From: allan2 Date: Fri, 21 May 2021 16:52:01 -0230 Subject: [PATCH 2/3] Wording nit Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com> --- docs/more/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/more/debugging.md b/docs/more/debugging.md index 1525aa56c0a..bdeca6ca7aa 100644 --- a/docs/more/debugging.md +++ b/docs/more/debugging.md @@ -6,7 +6,7 @@ title: Debugging The [`console_error_panic`](https://github.com/rustwasm/console_error_panic_hook) crate catches `panic!`s and outputs them to the console. Yew automatically catches `panic!`s and logs them to -the browser console. +the browser's console. ## Console Logging From a2cdbe387ea8ffa5403348807e7afba63e4bc2d7 Mon Sep 17 00:00:00 2001 From: allan2 Date: Fri, 21 May 2021 16:52:18 -0230 Subject: [PATCH 3/3] Improvement in browser API sentence Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com> --- docs/more/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/more/debugging.md b/docs/more/debugging.md index bdeca6ca7aa..2c79ec03fdb 100644 --- a/docs/more/debugging.md +++ b/docs/more/debugging.md @@ -10,7 +10,7 @@ the browser's console. ## Console Logging -In general, Wasm web apps are able to interact with Browser APIs. The `console.log` API is no +Wasm web apps can call Browser APIs. The `console.log` API is no exception. There are a few options available: ### [`wasm-logger`](https://crates.io/crates/wasm-logger)